Clip a multi-line based on the from/to range of one of its ordinates.
Use for m- and z- clipping
Clip a multi-line based on the from/to range of one of its ordinates.
Definition at line 470 of file lwlinearreferencing.c.
References LWCOLLECTION::bbox, COLLECTIONTYPE, LWCOLLECTION::flags, FLAGS_SET_M, FLAGS_SET_Z, LWMLINE::geoms, LWCOLLECTION::geoms, lwalloc(), lwcollection_construct_empty(), lwerror(), lwfree(), lwgeom_add_bbox(), lwgeom_drop_bbox(), lwgeom_has_m(), lwgeom_has_z(), lwline_clip_to_ordinate_range(), lwmline_as_lwgeom(), lwrealloc(), MULTILINETYPE, LWMLINE::ngeoms, LWCOLLECTION::ngeoms, LWMLINE::srid, LWMLINE::type, and LWCOLLECTION::type.
Referenced by lwgeom_clip_to_ordinate_range(), and test_lwmline_clip().
476 lwerror(
"Null input geometry.");
490 char homogeneous = 1;
491 size_t geoms_size = 0;
495 for ( i = 0; i < mline->
ngeoms; i ++ )
504 if ( lwgeom_out->
geoms )
513 for ( j = 0; j < col->
ngeoms; j++ )
528 if ( lwgeom_out->
bbox )
LWGEOM * lwmline_as_lwgeom(const LWMLINE *obj)
LWCOLLECTION * lwline_clip_to_ordinate_range(const LWLINE *line, char ordinate, double from, double to)
Take in a LINESTRING and return a MULTILINESTRING of those portions of the LINESTRING between the fro...
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.
#define FLAGS_SET_Z(flags, value)
void * lwrealloc(void *mem, size_t size)
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
void * lwalloc(size_t size)
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.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
#define FLAGS_SET_M(flags, value)