PostGIS  2.1.10dev-r@@SVN_REVISION@@
LWCIRCSTRING* lwcircstring_construct ( int  srid,
GBOX bbox,
POINTARRAY points 
)

Definition at line 38 of file lwcircstring.c.

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

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

39 {
41 
42  /*
43  * The first arc requires three points. Each additional
44  * arc requires two more points. Thus the minimum point count
45  * is three, and the count must be odd.
46  */
47  if (points->npoints % 2 != 1 || points->npoints < 3)
48  {
49  lwnotice("lwcircstring_construct: invalid point count %d", points->npoints);
50  }
51 
52  result = (LWCIRCSTRING*) lwalloc(sizeof(LWCIRCSTRING));
53 
54  result->type = CIRCSTRINGTYPE;
55 
56  result->flags = points->flags;
57  FLAGS_SET_BBOX(result->flags, bbox?1:0);
58 
59  result->srid = srid;
60  result->points = points;
61  result->bbox = bbox;
62 
63  return result;
64 }
uint8_t flags
Definition: liblwgeom.h:397
int npoints
Definition: liblwgeom.h:327
int32_t srid
Definition: liblwgeom.h:399
char ** result
Definition: liblwgeom.h:218
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:54
uint8_t flags
Definition: liblwgeom.h:325
uint8_t type
Definition: liblwgeom.h:396
GBOX * bbox
Definition: liblwgeom.h:398
#define FLAGS_SET_BBOX(flags, value)
Definition: liblwgeom.h:114
POINTARRAY * points
Definition: liblwgeom.h:400
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:67
void * lwalloc(size_t size)
Definition: lwutil.c:175

Here is the call graph for this function:

Here is the caller graph for this function: