Clip a point based on the from/to range of one of its ordinates.
Use for m- and z- clipping
Clip a point based on the from/to range of one of its ordinates.
Definition at line 364 of file lwlinearreferencing.c.
References LWCOLLECTION::bbox, lwcollection_add_lwgeom(), lwcollection_construct_empty(), lwerror(), lwgeom_add_bbox(), lwgeom_drop_bbox(), lwgeom_has_m(), lwgeom_has_z(), lwpoint_as_lwgeom(), lwpoint_clone(), lwpoint_get_ordinate(), lwpoint_getPoint4d_p(), MULTIPOINTTYPE, and LWPOINT::srid.
Referenced by lwgeom_clip_to_ordinate_range().
369 double ordinate_value;
373 lwerror(
"Null input geometry.");
393 if ( from <= ordinate_value && to >= ordinate_value )
400 if ( lwgeom_out->
bbox )
double lwpoint_get_ordinate(const POINT4D *p, char ordinate)
Given a POINT4D and an ordinate number, return the value of the ordinate.
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
LWPOINT * lwpoint_clone(const LWPOINT *lwgeom)
int lwpoint_getPoint4d_p(const LWPOINT *point, POINT4D *out)
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.