PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwgeom_split()

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

Definition at line 585 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(), ST_Split(), and test_lwgeom_split().

586 {
587  switch (lwgeom_in->type)
588  {
589  case LINETYPE:
590  return lwline_split((const LWLINE*)lwgeom_in, blade_in);
591 
592  case POLYGONTYPE:
593  return lwpoly_split((const LWPOLY*)lwgeom_in, blade_in);
594 
595  case MULTIPOLYGONTYPE:
596  case MULTILINETYPE:
597  case COLLECTIONTYPE:
598  return lwcollection_split((const LWCOLLECTION*)lwgeom_in, blade_in);
599 
600  default:
601  lwerror("Splitting of %s geometries is unsupported",
602  lwtype_name(lwgeom_in->type));
603  return NULL;
604  }
605 
606 }
#define LINETYPE
Definition: liblwgeom.h:71
static LWGEOM * lwline_split(const LWLINE *lwgeom_in, const LWGEOM *blade_in)
#define POLYGONTYPE
Definition: liblwgeom.h:72
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:188
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:75
static LWGEOM * lwpoly_split(const LWPOLY *lwpoly_in, const LWGEOM *blade_in)
uint8_t type
Definition: liblwgeom.h:380
#define MULTILINETYPE
Definition: liblwgeom.h:74
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
#define COLLECTIONTYPE
Definition: liblwgeom.h:76
Here is the call graph for this function:
Here is the caller graph for this function: