PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ lwgeom_split()

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

Definition at line 572 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().

573 {
574  switch (lwgeom_in->type)
575  {
576  case LINETYPE:
577  return lwline_split((const LWLINE*)lwgeom_in, blade_in);
578 
579  case POLYGONTYPE:
580  return lwpoly_split((const LWPOLY*)lwgeom_in, blade_in);
581 
582  case MULTIPOLYGONTYPE:
583  case MULTILINETYPE:
584  case COLLECTIONTYPE:
585  return lwcollection_split((const LWCOLLECTION*)lwgeom_in, blade_in);
586 
587  default:
588  lwerror("Splitting of %s geometries is unsupported",
589  lwtype_name(lwgeom_in->type));
590  return NULL;
591  }
592 
593 }
#define LINETYPE
Definition: liblwgeom.h:85
static LWGEOM * lwline_split(const LWLINE *lwgeom_in, const LWGEOM *blade_in)
#define POLYGONTYPE
Definition: liblwgeom.h:86
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:216
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
static LWGEOM * lwpoly_split(const LWPOLY *lwpoly_in, const LWGEOM *blade_in)
uint8_t type
Definition: liblwgeom.h:395
#define MULTILINETYPE
Definition: liblwgeom.h:88
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:102
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
Here is the call graph for this function:
Here is the caller graph for this function: