PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ geos_geomunion()

Datum geos_geomunion ( PG_FUNCTION_ARGS  )

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

592 {
593  GSERIALIZED *geom1;
594  GSERIALIZED *geom2;
595  GSERIALIZED *result;
596  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
597 
598  geom1 = PG_GETARG_GSERIALIZED_P(0);
599  geom2 = PG_GETARG_GSERIALIZED_P(1);
600 
601  lwgeom1 = lwgeom_from_gserialized(geom1) ;
602  lwgeom2 = lwgeom_from_gserialized(geom2) ;
603 
604  lwresult = lwgeom_union(lwgeom1, lwgeom2) ;
605  result = geometry_serialize(lwresult) ;
606 
607  lwgeom_free(lwgeom1) ;
608  lwgeom_free(lwgeom2) ;
609  lwgeom_free(lwresult) ;
610 
611  PG_FREE_IF_COPY(geom1, 0);
612  PG_FREE_IF_COPY(geom2, 1);
613 
614  PG_RETURN_POINTER(result);
615 }
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_union(const LWGEOM *geom1, const LWGEOM *geom2)
Here is the call graph for this function:
Here is the caller graph for this function: