PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ lwcircstring_construct()

LWCIRCSTRING * lwcircstring_construct ( int32_t  srid,
GBOX bbox,
POINTARRAY points 
)
extern

Definition at line 50 of file lwcircstring.c.

51{
52 LWCIRCSTRING *result;
53
54 /*
55 * The first arc requires three points. Each additional
56 * arc requires two more points. Thus the minimum point count
57 * is three, and the count must be odd.
58 */
59 if (points->npoints % 2 != 1 || points->npoints < 3)
60 {
61 lwnotice("lwcircstring_construct: invalid point count %d", points->npoints);
62 }
63
64 result = (LWCIRCSTRING*) lwalloc(sizeof(LWCIRCSTRING));
65
66 result->type = CIRCSTRINGTYPE;
67
68 result->flags = points->flags;
69 FLAGS_SET_BBOX(result->flags, bbox?1:0);
70
71 result->srid = srid;
72 result->points = points;
73 result->bbox = bbox;
74
75 return result;
76}
#define FLAGS_SET_BBOX(flags, value)
Definition liblwgeom.h:188
void * lwalloc(size_t size)
Definition lwutil.c:227
#define CIRCSTRINGTYPE
Definition liblwgeom.h:123
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition lwutil.c:177
uint8_t type
Definition liblwgeom.h:496
int32_t srid
Definition liblwgeom.h:494
lwflags_t flags
Definition liblwgeom.h:495
POINTARRAY * points
Definition liblwgeom.h:493
GBOX * bbox
Definition liblwgeom.h:492
lwflags_t flags
Definition liblwgeom.h:417
uint32_t npoints
Definition liblwgeom.h:413

References LWCIRCSTRING::bbox, CIRCSTRINGTYPE, POINTARRAY::flags, LWCIRCSTRING::flags, FLAGS_SET_BBOX, lwalloc(), lwnotice(), POINTARRAY::npoints, LWCIRCSTRING::points, LWCIRCSTRING::srid, and LWCIRCSTRING::type.

Referenced by circstring_from_pa(), lwcircstring_addpoint(), lwcircstring_from_lwmpoint(), lwcircstring_from_lwpointarray(), lwcircstring_from_wkb_state(), lwcircstring_removepoint(), and wkt_parser_circularstring_new().

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