PostGIS  2.1.10dev-r@@SVN_REVISION@@
const POINT3DZ* getPoint3dz_cp ( const POINTARRAY pa,
int  n 
)

Returns a POINT3DZ pointer into the POINTARRAY serialized_ptlist, suitable for reading from.

This is very high performance and declared const because you aren't allowed to muck with the values, only read them.

Definition at line 472 of file lwgeom_api.c.

References POINTARRAY::flags, FLAGS_GET_Z, getPoint_internal(), lwerror(), and POINTARRAY::npoints.

Referenced by pointArray_to_geojson(), pointArray_toGML2(), pointArray_toGML3(), and ptarray_to_GEOSCoordSeq().

473 {
474  if ( ! pa ) return 0;
475 
476  if ( ! FLAGS_GET_Z(pa->flags) )
477  {
478  lwerror("getPoint3dz_cp: no Z coordinates in point array");
479  return 0; /*error */
480  }
481 
482  if ( (n<0) || (n>=pa->npoints))
483  {
484  lwerror("getPoint3dz_cp: point offset out of range");
485  return 0; /*error */
486  }
487 
488  return (const POINT3DZ*)getPoint_internal(pa, n);
489 }
int npoints
Definition: liblwgeom.h:327
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
uint8_t flags
Definition: liblwgeom.h:325
uint8_t * getPoint_internal(const POINTARRAY *pa, int n)
Definition: ptarray.c:1645
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:106

Here is the call graph for this function:

Here is the caller graph for this function: