Clip an input MULTIPOINT between two values, on any ordinate input.
Clip a multi-point based on the from/to range of one of its ordinates.
Definition at line 415 of file lwlinearreferencing.c.
References LWCOLLECTION::bbox, LWMPOINT::geoms, lwcollection_add_lwgeom(), lwcollection_construct_empty(), lwerror(), lwgeom_add_bbox(), lwgeom_drop_bbox(), lwgeom_has_m(), lwgeom_has_z(), lwmpoint_as_lwgeom(), lwpoint_as_lwgeom(), lwpoint_clone(), lwpoint_get_ordinate(), lwpoint_getPoint4d_p(), MULTIPOINTTYPE, LWMPOINT::ngeoms, and LWMPOINT::srid.
Referenced by lwgeom_clip_to_ordinate_range().
423 lwerror(
"Null input geometry.");
441 for ( i = 0; i < mpoint->
ngeoms; i ++ )
444 double ordinate_value;
449 if ( from <= ordinate_value && to >= ordinate_value )
457 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.
LWGEOM * lwmpoint_as_lwgeom(const LWMPOINT *obj)