3245{
3247 double za = 0.0, zb = 0.0;
3249 uint32_t i;
3251 double length = 0.0;
3252 double seglength = 0.0;
3253
3254
3255 if ( ! pa || pa->
npoints < 2 )
3256 return 0.0;
3257
3258
3260
3261
3264 if ( hasz )
3266
3267
3268 for ( i = 1; i < pa->
npoints; i++ )
3269 {
3270 seglength = 0.0;
3273 if ( hasz )
3275
3276
3279
3280 else
3282
3283
3284 if ( hasz )
3285 seglength = sqrt( (zb-za)*(zb-za) + seglength*seglength );
3286
3287
3288 length += seglength;
3289
3290
3291 a = b;
3292 za = zb;
3293 }
3294 return length;
3295}
#define FLAGS_GET_Z(flags)
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
double sphere_distance(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e)
Given two points on a unit sphere, calculate their distance apart in radians.
double spheroid_distance(const GEOGRAPHIC_POINT *a, const GEOGRAPHIC_POINT *b, const SPHEROID *spheroid)
Computes the shortest distance along the surface of the spheroid between two points,...
Point in spherical coordinates on the world.