PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ geos_geomunion()

Datum geos_geomunion ( PG_FUNCTION_ARGS  )

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

517 {
518  GSERIALIZED *geom1;
519  GSERIALIZED *geom2;
520  GSERIALIZED *result;
521  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
522 
523  geom1 = PG_GETARG_GSERIALIZED_P(0);
524  geom2 = PG_GETARG_GSERIALIZED_P(1);
525 
526  lwgeom1 = lwgeom_from_gserialized(geom1) ;
527  lwgeom2 = lwgeom_from_gserialized(geom2) ;
528 
529  lwresult = lwgeom_union(lwgeom1, lwgeom2) ;
530  result = geometry_serialize(lwresult) ;
531 
532  lwgeom_free(lwgeom1) ;
533  lwgeom_free(lwgeom2) ;
534  lwgeom_free(lwresult) ;
535 
536  PG_FREE_IF_COPY(geom1, 0);
537  PG_FREE_IF_COPY(geom2, 1);
538 
539  PG_RETURN_POINTER(result);
540 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1063
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: