PostGIS  2.5.7dev-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.

99 {
100  POINT4D p1, p2, p3, p4;
101  LWPOLY *poly;
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;
112  poly = lwpoly_construct_rectangle(0, 0, &p1, &p2, &p3, &p4);
113  lwgeom_set_srid(lwpoly_as_lwgeom(poly), srid);
116  return poly;
117 }
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
Definition: lwgeom.c:320
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...
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
Definition: lwgeom.c:686
LWPOLY * lwpoly_construct_rectangle(char hasz, char hasm, POINT4D *p1, POINT4D *p2, POINT4D *p3, POINT4D *p4)
Definition: lwpoly.c:80
double x
Definition: liblwgeom.h:355
double y
Definition: liblwgeom.h:355

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

Referenced by lwgeom_subdivide_recursive(), mvt_safe_clip_polygon_by_box(), rect_tree_to_lwgeom(), and ST_MakeEnvelope().

Here is the call graph for this function:
Here is the caller graph for this function: