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

Definition at line 238 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().

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

Here is the call graph for this function:

Here is the caller graph for this function: