PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ptarray_check_geodetic()

static int ptarray_check_geodetic ( const POINTARRAY pa)
static

Definition at line 3052 of file lwgeodetic.c.

References getPoint2d_p(), LW_FALSE, LW_TRUE, POINTARRAY::npoints, POINT2D::x, and POINT2D::y.

Referenced by lwline_check_geodetic(), lwpoint_check_geodetic(), lwpoly_check_geodetic(), and lwtriangle_check_geodetic().

3053 {
3054  int t;
3055  POINT2D pt;
3056 
3057  assert(pa);
3058 
3059  for (t=0; t<pa->npoints; t++)
3060  {
3061  getPoint2d_p(pa, t, &pt);
3062  /* printf( "%d (%g, %g)\n", t, pt.x, pt.y); */
3063  if ( pt.x < -180.0 || pt.y < -90.0 || pt.x > 180.0 || pt.y > 90.0 )
3064  return LW_FALSE;
3065  }
3066 
3067  return LW_TRUE;
3068 }
int npoints
Definition: liblwgeom.h:371
double x
Definition: liblwgeom.h:328
#define LW_FALSE
Definition: liblwgeom.h:77
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
double y
Definition: liblwgeom.h:328
int getPoint2d_p(const POINTARRAY *pa, int n, POINT2D *point)
Definition: lwgeom_api.c:347
Here is the call graph for this function:
Here is the caller graph for this function: