PostGIS  2.2.7dev-r@@SVN_REVISION@@
Datum geos_intersection ( PG_FUNCTION_ARGS  )

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

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

1389 {
1390  GSERIALIZED *geom1;
1391  GSERIALIZED *geom2;
1392  GSERIALIZED *result;
1393  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
1394 
1395  geom1 = PG_GETARG_GSERIALIZED_P(0);
1396  geom2 = PG_GETARG_GSERIALIZED_P(1);
1397 
1398  lwgeom1 = lwgeom_from_gserialized(geom1) ;
1399  lwgeom2 = lwgeom_from_gserialized(geom2) ;
1400 
1401  lwresult = lwgeom_intersection(lwgeom1, lwgeom2) ;
1402  result = geometry_serialize(lwresult) ;
1403 
1404  lwgeom_free(lwgeom1) ;
1405  lwgeom_free(lwgeom2) ;
1406  lwgeom_free(lwresult) ;
1407 
1408  PG_FREE_IF_COPY(geom1, 0);
1409  PG_FREE_IF_COPY(geom2, 1);
1410 
1411  PG_RETURN_POINTER(result);
1412 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
LWGEOM * lwgeom_intersection(const LWGEOM *geom1, const LWGEOM *geom2)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: