PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwpoly_construct_rectangle()

LWPOLY* lwpoly_construct_rectangle ( char  hasz,
char  hasm,
POINT4D p1,
POINT4D p2,
POINT4D p3,
POINT4D p4 
)

Definition at line 80 of file lwpoly.c.

References LW_TRUE, lwpoly_add_ring(), lwpoly_construct_empty(), ptarray_append_point(), ptarray_construct_empty(), and SRID_UNKNOWN.

Referenced by BOX2D_to_LWGEOM(), BOX3D_to_LWGEOM(), LWGEOM_expand(), and lwpoly_construct_envelope().

82 {
83  POINTARRAY *pa = ptarray_construct_empty(hasz, hasm, 5);
84  LWPOLY *lwpoly = lwpoly_construct_empty(SRID_UNKNOWN, hasz, hasm);
85 
91 
92  lwpoly_add_ring(lwpoly, pa);
93 
94  return lwpoly;
95 }
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
Definition: ptarray.c:70
int lwpoly_add_ring(LWPOLY *poly, POINTARRAY *pa)
Add a ring to a polygon.
Definition: lwpoly.c:249
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int allow_duplicates)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE, then a duplicate point will not be added.
Definition: ptarray.c:156
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:188
LWPOLY * lwpoly_construct_empty(int srid, char hasz, char hasm)
Definition: lwpoly.c:161
Here is the call graph for this function:
Here is the caller graph for this function: