PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ ST_Intersection()

Datum ST_Intersection ( PG_FUNCTION_ARGS  )

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

1300{
1301 GSERIALIZED *geom1;
1302 GSERIALIZED *geom2;
1303 GSERIALIZED *result;
1304 LWGEOM *lwgeom1, *lwgeom2, *lwresult;
1305
1306 geom1 = PG_GETARG_GSERIALIZED_P(0);
1307 geom2 = PG_GETARG_GSERIALIZED_P(1);
1308
1309 lwgeom1 = lwgeom_from_gserialized(geom1);
1310 lwgeom2 = lwgeom_from_gserialized(geom2);
1311
1312 lwresult = lwgeom_intersection(lwgeom1, lwgeom2);
1313 result = geometry_serialize(lwresult);
1314
1315 lwgeom_free(lwgeom1);
1316 lwgeom_free(lwgeom2);
1317 lwgeom_free(lwresult);
1318
1319 PG_FREE_IF_COPY(geom1, 0);
1320 PG_FREE_IF_COPY(geom2, 1);
1321
1322 PG_RETURN_POINTER(result);
1323}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1138
LWGEOM * lwgeom_intersection(const LWGEOM *geom1, const LWGEOM *geom2)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

References geometry_serialize(), lwgeom_free(), lwgeom_from_gserialized(), and lwgeom_intersection().

Here is the call graph for this function: