PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ ST_Intersection()

Datum ST_Intersection ( PG_FUNCTION_ARGS  )

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

1464 {
1465  GSERIALIZED *geom1;
1466  GSERIALIZED *geom2;
1468  LWGEOM *lwgeom1, *lwgeom2, *lwresult;
1469  double prec = -1;
1470 
1471  geom1 = PG_GETARG_GSERIALIZED_P(0);
1472  geom2 = PG_GETARG_GSERIALIZED_P(1);
1473  if (PG_NARGS() > 2 && ! PG_ARGISNULL(2))
1474  prec = PG_GETARG_FLOAT8(2);
1475 
1476  lwgeom1 = lwgeom_from_gserialized(geom1);
1477  lwgeom2 = lwgeom_from_gserialized(geom2);
1478 
1479  lwresult = lwgeom_intersection_prec(lwgeom1, lwgeom2, prec);
1480  result = geometry_serialize(lwresult);
1481 
1482  lwgeom_free(lwgeom1);
1483  lwgeom_free(lwgeom2);
1484  lwgeom_free(lwresult);
1485 
1486  PG_FREE_IF_COPY(geom1, 0);
1487  PG_FREE_IF_COPY(geom2, 1);
1488 
1489  PG_RETURN_POINTER(result);
1490 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:262
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: