PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ ST_Intersection()

Datum ST_Intersection ( PG_FUNCTION_ARGS  )

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

1347 {
1348  GSERIALIZED *geom1;
1349  GSERIALIZED *geom2;
1351  LWGEOM *lwgeom1, *lwgeom2, *lwresult;
1352  double prec = -1;
1353 
1354  geom1 = PG_GETARG_GSERIALIZED_P(0);
1355  geom2 = PG_GETARG_GSERIALIZED_P(1);
1356  if (PG_NARGS() > 2 && ! PG_ARGISNULL(2))
1357  prec = PG_GETARG_FLOAT8(2);
1358 
1359  lwgeom1 = lwgeom_from_gserialized(geom1);
1360  lwgeom2 = lwgeom_from_gserialized(geom2);
1361 
1362  lwresult = lwgeom_intersection_prec(lwgeom1, lwgeom2, prec);
1363  result = geometry_serialize(lwresult);
1364 
1365  lwgeom_free(lwgeom1);
1366  lwgeom_free(lwgeom2);
1367  lwgeom_free(lwresult);
1368 
1369  PG_FREE_IF_COPY(geom1, 0);
1370  PG_FREE_IF_COPY(geom2, 1);
1371 
1372  PG_RETURN_POINTER(result);
1373 }
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.
Definition: gserialized.c:239
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1155
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: