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

Returns a POINT2D 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.

Returns a POINT2D 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 458 of file lwgeom_api.c.

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

Referenced by getPoint2d(), lw_curvering_getfirstpoint2d_cp(), lw_dist2d_fast_ptarray_ptarray(), lw_dist2d_line_curvepoly(), lw_dist2d_line_poly(), lw_dist2d_point_circstring(), lw_dist2d_point_curvepoly(), lw_dist2d_point_line(), lw_dist2d_point_point(), lw_dist2d_point_poly(), lw_dist2d_poly_poly(), lw_dist2d_pre_seg_seg(), lw_dist2d_pt_ptarray(), lw_dist2d_pt_ptarrayarc(), lw_dist2d_ptarray_ptarray(), lw_dist2d_ptarray_ptarrayarc(), lw_dist2d_ptarrayarc_ptarrayarc(), pointArray_svg_rel(), pointArray_to_geojson(), pointArray_toGML2(), pointArray_toGML3(), pt_in_ring_2d(), ptarray_arc_length_2d(), ptarray_area_sphere(), ptarray_calculate_gbox_geodetic(), ptarray_contains_point_partial(), ptarray_dp_findsplit(), ptarray_length_2d(), ptarray_locate_point(), ptarray_signed_area(), ptarray_to_GEOSCoordSeq(), and ptarrayarc_contains_point_partial().

459 {
460  if ( ! pa ) return 0;
461 
462  if ( (n<0) || (n>=pa->npoints))
463  {
464  lwerror("getPoint2D_const_p: point offset out of range");
465  return 0; /*error */
466  }
467 
468  return (const POINT2D*)getPoint_internal(pa, n);
469 }
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 * getPoint_internal(const POINTARRAY *pa, int n)
Definition: ptarray.c:1645

Here is the call graph for this function:

Here is the caller graph for this function: