PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ lwpoint_force_dims()

LWPOINT* lwpoint_force_dims ( const LWPOINT lwpoint,
int  hasz,
int  hasm,
double  zval,
double  mval 
)

Definition at line 304 of file lwpoint.c.

305 {
306  POINTARRAY *pdims = NULL;
307  LWPOINT *pointout;
308 
309  /* Return 2D empty */
310  if( lwpoint_is_empty(point) )
311  {
312  pointout = lwpoint_construct_empty(point->srid, hasz, hasm);
313  }
314  else
315  {
316  /* Always we duplicate the ptarray and return */
317  pdims = ptarray_force_dims(point->point, hasz, hasm, zval, mval);
318  pointout = lwpoint_construct(point->srid, NULL, pdims);
319  }
320  pointout->type = point->type;
321  return pointout;
322 }
POINTARRAY * ptarray_force_dims(const POINTARRAY *pa, int hasz, int hasm, double zval, double mval)
Definition: ptarray.c:1056
int lwpoint_is_empty(const LWPOINT *point)
LWPOINT * lwpoint_construct_empty(int32_t srid, char hasz, char hasm)
Definition: lwpoint.c:151
LWPOINT * lwpoint_construct(int32_t srid, GBOX *bbox, POINTARRAY *point)
Definition: lwpoint.c:129
uint8_t type
Definition: liblwgeom.h:474

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

Referenced by lwgeom_force_dims().

Here is the call graph for this function:
Here is the caller graph for this function: