PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ symdifference()

Datum symdifference ( PG_FUNCTION_ARGS  )

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

625 {
626  GSERIALIZED *geom1;
627  GSERIALIZED *geom2;
628  GSERIALIZED *result;
629  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
630 
631  geom1 = PG_GETARG_GSERIALIZED_P(0);
632  geom2 = PG_GETARG_GSERIALIZED_P(1);
633 
634  lwgeom1 = lwgeom_from_gserialized(geom1) ;
635  lwgeom2 = lwgeom_from_gserialized(geom2) ;
636 
637  lwresult = lwgeom_symdifference(lwgeom1, lwgeom2) ;
638  result = geometry_serialize(lwresult) ;
639 
640  lwgeom_free(lwgeom1) ;
641  lwgeom_free(lwgeom2) ;
642  lwgeom_free(lwresult) ;
643 
644  PG_FREE_IF_COPY(geom1, 0);
645  PG_FREE_IF_COPY(geom2, 1);
646 
647  PG_RETURN_POINTER(result);
648 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
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: