PostGIS  2.1.10dev-r@@SVN_REVISION@@
Datum geomunion ( PG_FUNCTION_ARGS  )

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

References geometry_serialize(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_union(), and result.

840 {
841  GSERIALIZED *geom1;
842  GSERIALIZED *geom2;
844  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
845 
846  geom1 = (GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
847  geom2 = (GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(1));
848 
849  lwgeom1 = lwgeom_from_gserialized(geom1) ;
850  lwgeom2 = lwgeom_from_gserialized(geom2) ;
851 
852  lwresult = lwgeom_union(lwgeom1, lwgeom2) ;
853  result = geometry_serialize(lwresult) ;
854 
855  lwgeom_free(lwgeom1) ;
856  lwgeom_free(lwgeom2) ;
857  lwgeom_free(lwresult) ;
858 
859  PG_FREE_IF_COPY(geom1, 0);
860  PG_FREE_IF_COPY(geom2, 1);
861 
862  PG_RETURN_POINTER(result);
863 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
char ** result
Definition: liblwgeom.h:218
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
LWGEOM * lwgeom_union(const LWGEOM *geom1, const LWGEOM *geom2)

Here is the call graph for this function: