PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ geos_geomunion()

Datum geos_geomunion ( PG_FUNCTION_ARGS  )

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

555 {
556  GSERIALIZED *geom1;
557  GSERIALIZED *geom2;
558  GSERIALIZED *result;
559  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
560 
561  geom1 = PG_GETARG_GSERIALIZED_P(0);
562  geom2 = PG_GETARG_GSERIALIZED_P(1);
563 
564  lwgeom1 = lwgeom_from_gserialized(geom1) ;
565  lwgeom2 = lwgeom_from_gserialized(geom2) ;
566 
567  lwresult = lwgeom_union(lwgeom1, lwgeom2) ;
568  result = geometry_serialize(lwresult) ;
569 
570  lwgeom_free(lwgeom1) ;
571  lwgeom_free(lwgeom2) ;
572  lwgeom_free(lwresult) ;
573 
574  PG_FREE_IF_COPY(geom1, 0);
575  PG_FREE_IF_COPY(geom2, 1);
576 
577  PG_RETURN_POINTER(result);
578 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * lwgeom_union(const LWGEOM *geom1, const LWGEOM *geom2)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

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

Here is the call graph for this function: