PostGIS  2.3.7dev-r@@SVN_REVISION@@
const POINT4D* getPoint4d_cp ( const POINTARRAY pa,
int  n 
)

Returns a POINT4D 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 520 of file lwgeom_api.c.

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

521 {
522  if ( ! pa ) return 0;
523 
524  if ( ! (FLAGS_GET_Z(pa->flags) && FLAGS_GET_Z(pa->flags)) )
525  {
526  lwerror("getPoint3dz_cp: no Z and M coordinates in point array");
527  return 0; /*error */
528  }
529 
530  if ( (n<0) || (n>=pa->npoints))
531  {
532  lwerror("getPoint3dz_cp: point offset out of range");
533  return 0; /*error */
534  }
535 
536  return (const POINT4D*)getPoint_internal(pa, n);
537 }
int npoints
Definition: liblwgeom.h:370
uint8_t flags
Definition: liblwgeom.h:368
uint8_t * getPoint_internal(const POINTARRAY *pa, int n)
Definition: ptarray.c:1706
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:139
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:102

Here is the call graph for this function: