PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwgeom_split()

LWGEOM* lwgeom_split ( const LWGEOM lwgeom_in,
const LWGEOM blade_in 
)

Definition at line 562 of file lwgeom_geos_split.c.

References COLLECTIONTYPE, LINETYPE, lwcollection_split(), lwerror(), lwline_split(), lwpoly_split(), lwtype_name(), MULTILINETYPE, MULTIPOLYGONTYPE, POLYGONTYPE, LWGEOM::type, and LWCOLLECTION::type.

Referenced by _lwt_EdgeSplit(), _lwt_split_by_nodes(), lwcollection_split(), lwgeom_split_wrapx(), ST_Split(), and test_lwgeom_split().

563 {
564  switch (lwgeom_in->type)
565  {
566  case LINETYPE:
567  return lwline_split((const LWLINE*)lwgeom_in, blade_in);
568 
569  case POLYGONTYPE:
570  return lwpoly_split((const LWPOLY*)lwgeom_in, blade_in);
571 
572  case MULTIPOLYGONTYPE:
573  case MULTILINETYPE:
574  case COLLECTIONTYPE:
575  return lwcollection_split((const LWCOLLECTION*)lwgeom_in, blade_in);
576 
577  default:
578  lwerror("Splitting of %s geometries is unsupported",
579  lwtype_name(lwgeom_in->type));
580  return NULL;
581  }
582 
583 }
#define LINETYPE
Definition: liblwgeom.h:86
static LWGEOM * lwline_split(const LWLINE *lwgeom_in, const LWGEOM *blade_in)
#define POLYGONTYPE
Definition: liblwgeom.h:87
static LWGEOM * lwcollection_split(const LWCOLLECTION *lwcoll_in, const LWGEOM *blade_in)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
static LWGEOM * lwpoly_split(const LWPOLY *lwpoly_in, const LWGEOM *blade_in)
uint8_t type
Definition: liblwgeom.h:396
#define MULTILINETYPE
Definition: liblwgeom.h:89
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
Here is the call graph for this function:
Here is the caller graph for this function: