PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwpoly_construct_envelope()

LWPOLY* lwpoly_construct_envelope ( int  srid,
double  x1,
double  y1,
double  x2,
double  y2 
)

Definition at line 98 of file lwpoly.c.

References lwgeom_add_bbox(), lwgeom_set_srid(), lwpoly_as_lwgeom(), lwpoly_construct_rectangle(), POINT4D::x, and POINT4D::y.

Referenced by mvt_geom(), and ST_MakeEnvelope().

99 {
100  POINT4D p1, p2, p3, p4;
101  LWPOLY *poly;
102 
103  p1.x = x1;
104  p1.y = y1;
105  p2.x = x1;
106  p2.y = y2;
107  p3.x = x2;
108  p3.y = y2;
109  p4.x = x2;
110  p4.y = y1;
111 
112  poly = lwpoly_construct_rectangle(0, 0, &p1, &p2, &p3, &p4);
113  lwgeom_set_srid(lwpoly_as_lwgeom(poly), srid);
115 
116  return poly;
117 }
double x
Definition: liblwgeom.h:352
LWPOLY * lwpoly_construct_rectangle(char hasz, char hasm, POINT4D *p1, POINT4D *p2, POINT4D *p3, POINT4D *p4)
Definition: lwpoly.c:80
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
Definition: lwgeom.c:288
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
Definition: lwgeom.c:648
void lwgeom_set_srid(LWGEOM *geom, int srid)
Set the SRID on an LWGEOM For collections, only the parent gets an SRID, all the children get SRID_UN...
double y
Definition: liblwgeom.h:352
Here is the call graph for this function:
Here is the caller graph for this function: