PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ geos_difference()

Datum geos_difference ( PG_FUNCTION_ARGS  )

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

1223 {
1224  GSERIALIZED *geom1;
1225  GSERIALIZED *geom2;
1226  GSERIALIZED *result;
1227  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
1228 
1229  geom1 = PG_GETARG_GSERIALIZED_P(0);
1230  geom2 = PG_GETARG_GSERIALIZED_P(1);
1231 
1232  lwgeom1 = lwgeom_from_gserialized(geom1) ;
1233  lwgeom2 = lwgeom_from_gserialized(geom2) ;
1234 
1235  lwresult = lwgeom_difference(lwgeom1, lwgeom2) ;
1236  result = geometry_serialize(lwresult) ;
1237 
1238  lwgeom_free(lwgeom1) ;
1239  lwgeom_free(lwgeom2) ;
1240  lwgeom_free(lwresult) ;
1241 
1242  PG_FREE_IF_COPY(geom1, 0);
1243  PG_FREE_IF_COPY(geom2, 1);
1244 
1245  PG_RETURN_POINTER(result);
1246 }
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_difference(const LWGEOM *geom1, const LWGEOM *geom2)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

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

Here is the call graph for this function: