PostGIS  2.5.0dev-r@@SVN_REVISION@@
Datum geos_geomunion ( PG_FUNCTION_ARGS  )

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

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

569 {
570  GSERIALIZED *geom1;
571  GSERIALIZED *geom2;
572  GSERIALIZED *result;
573  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
574 
575  geom1 = PG_GETARG_GSERIALIZED_P(0);
576  geom2 = PG_GETARG_GSERIALIZED_P(1);
577 
578  lwgeom1 = lwgeom_from_gserialized(geom1) ;
579  lwgeom2 = lwgeom_from_gserialized(geom2) ;
580 
581  lwresult = lwgeom_union(lwgeom1, lwgeom2) ;
582  result = geometry_serialize(lwresult) ;
583 
584  lwgeom_free(lwgeom1) ;
585  lwgeom_free(lwgeom2) ;
586  lwgeom_free(lwresult) ;
587 
588  PG_FREE_IF_COPY(geom1, 0);
589  PG_FREE_IF_COPY(geom2, 1);
590 
591  PG_RETURN_POINTER(result);
592 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1137
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
LWGEOM * lwgeom_union(const LWGEOM *geom1, const LWGEOM *geom2)

Here is the call graph for this function: