PostGIS  2.3.7dev-r@@SVN_REVISION@@
LWPOINT* lwcircstring_get_lwpoint ( const LWCIRCSTRING circ,
int  where 
)

Definition at line 300 of file lwcircstring.c.

References LWCIRCSTRING::flags, FLAGS_GET_M, FLAGS_GET_Z, getPoint4d(), LW_TRUE, lwcircstring_is_empty(), lwpoint_construct(), POINTARRAY::npoints, LWCIRCSTRING::points, ptarray_append_point(), ptarray_construct_empty(), and LWCIRCSTRING::srid.

Referenced by LWGEOM_dumppoints().

300  {
301  POINT4D pt;
302  LWPOINT *lwpoint;
303  POINTARRAY *pa;
304 
305  if ( lwcircstring_is_empty(circ) || where < 0 || where >= circ->points->npoints )
306  return NULL;
307 
309  pt = getPoint4d(circ->points, where);
310  ptarray_append_point(pa, &pt, LW_TRUE);
311  lwpoint = lwpoint_construct(circ->srid, NULL, pa);
312  return lwpoint;
313 }
uint8_t flags
Definition: liblwgeom.h:440
int npoints
Definition: liblwgeom.h:370
int32_t srid
Definition: liblwgeom.h:442
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
Definition: ptarray.c:70
POINT4D getPoint4d(const POINTARRAY *pa, int n)
Definition: lwgeom_api.c:229
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:75
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:139
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:140
POINTARRAY * points
Definition: liblwgeom.h:443
LWPOINT * lwpoint_construct(int srid, GBOX *bbox, POINTARRAY *point)
Definition: lwpoint.c:111
int lwcircstring_is_empty(const LWCIRCSTRING *circ)
Definition: lwcircstring.c:276

Here is the call graph for this function:

Here is the caller graph for this function: