PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwgeom_split()

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

Definition at line 564 of file lwgeom_geos_split.c.

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

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

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

Here is the call graph for this function:
Here is the caller graph for this function: