PostGIS  2.3.7dev-r@@SVN_REVISION@@
Datum geos_difference ( PG_FUNCTION_ARGS  )

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

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

1179 {
1180  GSERIALIZED *geom1;
1181  GSERIALIZED *geom2;
1182  GSERIALIZED *result;
1183  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
1184 
1185  geom1 = PG_GETARG_GSERIALIZED_P(0);
1186  geom2 = PG_GETARG_GSERIALIZED_P(1);
1187 
1188  lwgeom1 = lwgeom_from_gserialized(geom1) ;
1189  lwgeom2 = lwgeom_from_gserialized(geom2) ;
1190 
1191  lwresult = lwgeom_difference(lwgeom1, lwgeom2) ;
1192  result = geometry_serialize(lwresult) ;
1193 
1194  lwgeom_free(lwgeom1) ;
1195  lwgeom_free(lwgeom2) ;
1196  lwgeom_free(lwresult) ;
1197 
1198  PG_FREE_IF_COPY(geom1, 0);
1199  PG_FREE_IF_COPY(geom2, 1);
1200 
1201  PG_RETURN_POINTER(result);
1202 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1063
LWGEOM * lwgeom_difference(const LWGEOM *geom1, const LWGEOM *geom2)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: