Clips the geometry using GEOSIntersection in a "safe way", cleaning the input if necessary and clipping MULTIPOLYGONs separately to reduce the impact of using invalid input in GEOS Might return NULL.
Definition at line 962 of file mvt.c.
987 for (i = 0; i < lwmg->
ngeoms; i++)
1003 for (j = 0; j < ((
LWCOLLECTION *)clipped)->ngeoms; j++)
void gbox_init(GBOX *gbox)
Zero out all the entries in the GBOX.
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
LWGEOM * lwcollection_getsubgeom(LWCOLLECTION *col, int gnum)
#define FLAGS_GET_Z(flags)
int lwgeom_is_collection(const LWGEOM *lwgeom)
Determine whether a LWGEOM can contain sub-geometries or not.
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
#define FLAGS_GET_M(flags)
int lwgeom_calculate_gbox(const LWGEOM *lwgeom, GBOX *gbox)
Calculate bounding box of a geometry, automatically taking into account whether it is cartesian or ge...
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
#define FLAGS_SET_GEODETIC(flags, value)
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
static LWGEOM * mvt_unsafe_clip_by_box(LWGEOM *lwg_in, GBOX *clip_box)
static LWGEOM * mvt_safe_clip_polygon_by_box(LWGEOM *lwg_in, GBOX *clip_box)
Clips an input geometry using GEOSIntersection It used to try to use GEOSClipByRect (as mvt_unsafe_cl...
static LWGEOM * lwgeom_to_basic_type(LWGEOM *geom, uint8 original_type)
In place process a collection to find a concrete geometry object and expose that as the actual object...
References GBOX::flags, LWGEOM::flags, FLAGS_GET_M, FLAGS_GET_Z, FLAGS_SET_GEODETIC, gbox_init(), lwcollection_add_lwgeom(), lwcollection_as_lwgeom(), lwcollection_construct_empty(), lwcollection_getsubgeom(), lwgeom_calculate_gbox(), lwgeom_is_collection(), lwgeom_is_empty(), lwgeom_to_basic_type(), MULTIPOLYGONTYPE, mvt_safe_clip_polygon_by_box(), mvt_unsafe_clip_by_box(), LWCOLLECTION::ngeoms, POLYGONTYPE, window::res, LWGEOM::srid, and LWGEOM::type.
Referenced by mvt_clip_and_validate_geos().