PostGIS  3.4.0dev-r@@SVN_REVISION@@
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages

◆ ST_Union()

Datum ST_Union ( PG_FUNCTION_ARGS  )

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

800 {
801  GSERIALIZED *geom1;
802  GSERIALIZED *geom2;
804  LWGEOM *lwgeom1, *lwgeom2, *lwresult;
805  double gridSize = -1;
806 
807  geom1 = PG_GETARG_GSERIALIZED_P(0);
808  geom2 = PG_GETARG_GSERIALIZED_P(1);
809  if (PG_NARGS() > 2 && ! PG_ARGISNULL(2))
810  gridSize = PG_GETARG_FLOAT8(2);
811 
812  lwgeom1 = lwgeom_from_gserialized(geom1);
813  lwgeom2 = lwgeom_from_gserialized(geom2);
814 
815  lwresult = lwgeom_union_prec(lwgeom1, lwgeom2, gridSize);
816  result = geometry_serialize(lwresult);
817 
818  lwgeom_free(lwgeom1);
819  lwgeom_free(lwgeom2);
820  lwgeom_free(lwresult);
821 
822  PG_FREE_IF_COPY(geom1, 0);
823  PG_FREE_IF_COPY(geom2, 1);
824 
825  PG_RETURN_POINTER(result);
826 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:262
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:239
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1155
LWGEOM * lwgeom_union_prec(const LWGEOM *geom1, const LWGEOM *geom2, double gridSize)

References lwgeom_free(), lwgeom_from_gserialized(), lwgeom_union_prec(), and result.

Here is the call graph for this function: