PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ geos_difference()

Datum geos_difference ( PG_FUNCTION_ARGS  )

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

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

Referenced by geos_intersection().

1254 {
1255  GSERIALIZED *geom1;
1256  GSERIALIZED *geom2;
1257  GSERIALIZED *result;
1258  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
1259 
1260  geom1 = PG_GETARG_GSERIALIZED_P(0);
1261  geom2 = PG_GETARG_GSERIALIZED_P(1);
1262 
1263  lwgeom1 = lwgeom_from_gserialized(geom1) ;
1264  lwgeom2 = lwgeom_from_gserialized(geom2) ;
1265 
1266  lwresult = lwgeom_difference(lwgeom1, lwgeom2) ;
1267  result = geometry_serialize(lwresult) ;
1268 
1269  lwgeom_free(lwgeom1) ;
1270  lwgeom_free(lwgeom2) ;
1271  lwgeom_free(lwresult) ;
1272 
1273  PG_FREE_IF_COPY(geom1, 0);
1274  PG_FREE_IF_COPY(geom2, 1);
1275 
1276  PG_RETURN_POINTER(result);
1277 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
LWGEOM * lwgeom_difference(const LWGEOM *geom1, const LWGEOM *geom2)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
Here is the call graph for this function:
Here is the caller graph for this function: