PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ lwpoly_construct_envelope()

LWPOLY* lwpoly_construct_envelope ( int32_t  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;
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 }
void lwgeom_set_srid(LWGEOM *geom, int32_t srid)
Set the SRID on an LWGEOM For collections, only the parent gets an SRID, all the children get SRID_UN...
Definition: lwgeom.c:1530
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
Definition: lwgeom.c:311
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
Definition: lwgeom.c:677
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:400
double y
Definition: liblwgeom.h:400

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(), ST_MakeEnvelope(), and ST_TileEnvelope().

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