PostGIS  2.2.7dev-r@@SVN_REVISION@@
LWPOINT* lwpoint_force_dims ( const LWPOINT lwpoint,
int  hasz,
int  hasm 
)

Definition at line 240 of file lwpoint.c.

References lwpoint_construct(), lwpoint_construct_empty(), lwpoint_is_empty(), LWPOINT::point, ptarray_force_dims(), LWPOINT::srid, and LWPOINT::type.

Referenced by lwgeom_force_dims().

241 {
242  POINTARRAY *pdims = NULL;
243  LWPOINT *pointout;
244 
245  /* Return 2D empty */
246  if( lwpoint_is_empty(point) )
247  {
248  pointout = lwpoint_construct_empty(point->srid, hasz, hasm);
249  }
250  else
251  {
252  /* Always we duplicate the ptarray and return */
253  pdims = ptarray_force_dims(point->point, hasz, hasm);
254  pointout = lwpoint_construct(point->srid, NULL, pdims);
255  }
256  pointout->type = point->type;
257  return pointout;
258 }
uint8_t type
Definition: liblwgeom.h:391
LWPOINT * lwpoint_construct_empty(int srid, char hasz, char hasm)
Definition: lwpoint.c:120
int lwpoint_is_empty(const LWPOINT *point)
Definition: lwpoint.c:260
LWPOINT * lwpoint_construct(int srid, GBOX *bbox, POINTARRAY *point)
Definition: lwpoint.c:98
POINTARRAY * ptarray_force_dims(const POINTARRAY *pa, int hasz, int hasm)
Definition: ptarray.c:1035

Here is the call graph for this function:

Here is the caller graph for this function: