PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ symdifference()

Datum symdifference ( PG_FUNCTION_ARGS  )

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

References boundary(), geometry_serialize(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_symdifference(), and PG_FUNCTION_INFO_V1().

Referenced by geos_geomunion().

802 {
803  GSERIALIZED *geom1;
804  GSERIALIZED *geom2;
805  GSERIALIZED *result;
806  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
807 
808  geom1 = PG_GETARG_GSERIALIZED_P(0);
809  geom2 = PG_GETARG_GSERIALIZED_P(1);
810 
811  lwgeom1 = lwgeom_from_gserialized(geom1) ;
812  lwgeom2 = lwgeom_from_gserialized(geom2) ;
813 
814  lwresult = lwgeom_symdifference(lwgeom1, lwgeom2) ;
815  result = geometry_serialize(lwresult) ;
816 
817  lwgeom_free(lwgeom1) ;
818  lwgeom_free(lwgeom2) ;
819  lwgeom_free(lwresult) ;
820 
821  PG_FREE_IF_COPY(geom1, 0);
822  PG_FREE_IF_COPY(geom2, 1);
823 
824  PG_RETURN_POINTER(result);
825 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
LWGEOM * lwgeom_symdifference(const LWGEOM *geom1, const LWGEOM *geom2)
Here is the call graph for this function:
Here is the caller graph for this function: