PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ lwgeom_split()

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

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

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