PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ geos_intersection()

Datum geos_intersection ( PG_FUNCTION_ARGS  )

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

1191 {
1192  GSERIALIZED *geom1;
1193  GSERIALIZED *geom2;
1194  GSERIALIZED *result;
1195  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
1196 
1197  geom1 = PG_GETARG_GSERIALIZED_P(0);
1198  geom2 = PG_GETARG_GSERIALIZED_P(1);
1199 
1200  lwgeom1 = lwgeom_from_gserialized(geom1) ;
1201  lwgeom2 = lwgeom_from_gserialized(geom2) ;
1202 
1203  lwresult = lwgeom_intersection(lwgeom1, lwgeom2) ;
1204  result = geometry_serialize(lwresult) ;
1205 
1206  lwgeom_free(lwgeom1) ;
1207  lwgeom_free(lwgeom2) ;
1208  lwgeom_free(lwresult) ;
1209 
1210  PG_FREE_IF_COPY(geom1, 0);
1211  PG_FREE_IF_COPY(geom2, 1);
1212 
1213  PG_RETURN_POINTER(result);
1214 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
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: