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

Definition at line 2063 of file lwgeom_functions_basic.c.

References geometry_serialize(), lwpoly_as_lwgeom(), lwpoly_construct_envelope(), lwpoly_free(), and SRID_UNKNOWN.

2064 {
2065  LWPOLY *poly;
2066  GSERIALIZED *result;
2067  double x1, y1, x2, y2;
2068  int srid = SRID_UNKNOWN;
2069 
2070  POSTGIS_DEBUG(2, "ST_MakeEnvelope called");
2071 
2072  x1 = PG_GETARG_FLOAT8(0);
2073  y1 = PG_GETARG_FLOAT8(1);
2074  x2 = PG_GETARG_FLOAT8(2);
2075  y2 = PG_GETARG_FLOAT8(3);
2076  if ( PG_NARGS() > 4 ) {
2077  srid = PG_GETARG_INT32(4);
2078  }
2079 
2080  poly = lwpoly_construct_envelope(srid, x1, y1, x2, y2);
2081 
2082  result = geometry_serialize(lwpoly_as_lwgeom(poly));
2083  lwpoly_free(poly);
2084 
2085  PG_RETURN_POINTER(result);
2086 }
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
Definition: lwgeom.c:319
LWPOLY * lwpoly_construct_envelope(int srid, double x1, double y1, double x2, double y2)
Definition: lwpoly.c:98
void lwpoly_free(LWPOLY *poly)
Definition: lwpoly.c:173
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:187
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: