PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ geos_geomunion()

Datum geos_geomunion ( PG_FUNCTION_ARGS  )

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

References geometry_serialize(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_union(), PG_FUNCTION_INFO_V1(), and symdifference().

Referenced by ST_UnaryUnion().

769 {
770  GSERIALIZED *geom1;
771  GSERIALIZED *geom2;
772  GSERIALIZED *result;
773  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
774 
775  geom1 = PG_GETARG_GSERIALIZED_P(0);
776  geom2 = PG_GETARG_GSERIALIZED_P(1);
777 
778  lwgeom1 = lwgeom_from_gserialized(geom1) ;
779  lwgeom2 = lwgeom_from_gserialized(geom2) ;
780 
781  lwresult = lwgeom_union(lwgeom1, lwgeom2) ;
782  result = geometry_serialize(lwresult) ;
783 
784  lwgeom_free(lwgeom1) ;
785  lwgeom_free(lwgeom2) ;
786  lwgeom_free(lwresult) ;
787 
788  PG_FREE_IF_COPY(geom1, 0);
789  PG_FREE_IF_COPY(geom2, 1);
790 
791  PG_RETURN_POINTER(result);
792 }
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_union(const LWGEOM *geom1, const LWGEOM *geom2)
Here is the call graph for this function:
Here is the caller graph for this function: