PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ symdifference()

Datum symdifference ( PG_FUNCTION_ARGS  )

Definition at line 586 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().

587 {
588  GSERIALIZED *geom1;
589  GSERIALIZED *geom2;
590  GSERIALIZED *result;
591  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
592 
593  geom1 = PG_GETARG_GSERIALIZED_P(0);
594  geom2 = PG_GETARG_GSERIALIZED_P(1);
595 
596  lwgeom1 = lwgeom_from_gserialized(geom1) ;
597  lwgeom2 = lwgeom_from_gserialized(geom2) ;
598 
599  lwresult = lwgeom_symdifference(lwgeom1, lwgeom2) ;
600  result = geometry_serialize(lwresult) ;
601 
602  lwgeom_free(lwgeom1) ;
603  lwgeom_free(lwgeom2) ;
604  lwgeom_free(lwresult) ;
605 
606  PG_FREE_IF_COPY(geom1, 0);
607  PG_FREE_IF_COPY(geom2, 1);
608 
609  PG_RETURN_POINTER(result);
610 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
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: