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

◆ ST_Intersection()

Datum ST_Intersection ( PG_FUNCTION_ARGS  )

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

1402{
1403 GSERIALIZED *geom1;
1404 GSERIALIZED *geom2;
1406 LWGEOM *lwgeom1, *lwgeom2, *lwresult;
1407 double prec = -1;
1408
1409 geom1 = PG_GETARG_GSERIALIZED_P(0);
1410 geom2 = PG_GETARG_GSERIALIZED_P(1);
1411 if (PG_NARGS() > 2 && ! PG_ARGISNULL(2))
1412 prec = PG_GETARG_FLOAT8(2);
1413
1414 lwgeom1 = lwgeom_from_gserialized(geom1);
1415 lwgeom2 = lwgeom_from_gserialized(geom2);
1416
1417 lwresult = lwgeom_intersection_prec(lwgeom1, lwgeom2, prec);
1418 result = geometry_serialize(lwresult);
1419
1420 lwgeom_free(lwgeom1);
1421 lwgeom_free(lwgeom2);
1422 lwgeom_free(lwresult);
1423
1424 PG_FREE_IF_COPY(geom1, 0);
1425 PG_FREE_IF_COPY(geom2, 1);
1426
1427 PG_RETURN_POINTER(result);
1428}
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition cu_print.c:267
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
LWGEOM * lwgeom_intersection_prec(const LWGEOM *geom1, const LWGEOM *geom2, double gridSize)

References lwgeom_free(), lwgeom_from_gserialized(), lwgeom_intersection_prec(), and result.

Here is the call graph for this function: