PostGIS  3.4.0dev-r@@SVN_REVISION@@
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages

◆ ST_Split()

Datum ST_Split ( PG_FUNCTION_ARGS  )

Definition at line 3394 of file postgis/lwgeom_geos.c.

3395 {
3396  GSERIALIZED *in, *blade_in, *out;
3397  LWGEOM *lwgeom_in, *lwblade_in, *lwgeom_out;
3398 
3399  in = PG_GETARG_GSERIALIZED_P(0);
3400  blade_in = PG_GETARG_GSERIALIZED_P(1);
3401  gserialized_error_if_srid_mismatch(in, blade_in, __func__);
3402 
3403  lwgeom_in = lwgeom_from_gserialized(in);
3404  lwblade_in = lwgeom_from_gserialized(blade_in);
3405 
3406  lwgeom_out = lwgeom_split(lwgeom_in, lwblade_in);
3407  lwgeom_free(lwgeom_in);
3408  lwgeom_free(lwblade_in);
3409 
3410  if ( ! lwgeom_out )
3411  {
3412  PG_FREE_IF_COPY(in, 0); /* possibly referenced by lwgeom_out */
3413  PG_FREE_IF_COPY(blade_in, 1);
3414  PG_RETURN_NULL();
3415  }
3416 
3417  out = geometry_serialize(lwgeom_out);
3418  lwgeom_free(lwgeom_out);
3419  PG_FREE_IF_COPY(in, 0); /* possibly referenced by lwgeom_out */
3420  PG_FREE_IF_COPY(blade_in, 1);
3421 
3422  PG_RETURN_POINTER(out);
3423 }
void gserialized_error_if_srid_mismatch(const GSERIALIZED *g1, const GSERIALIZED *g2, const char *funcname)
Definition: gserialized.c:403
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:239
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1155
LWGEOM * lwgeom_split(const LWGEOM *lwgeom_in, const LWGEOM *blade_in)

References gserialized_error_if_srid_mismatch(), lwgeom_free(), lwgeom_from_gserialized(), and lwgeom_split().

Here is the call graph for this function: