Create a new point array with no segment longer than the input segment length (expressed in radians!)
1692 lwerror(
"%s: null input pointarray", __func__);
1693 if ( max_seg_length <= 0.0 )
1694 lwerror(
"%s: maximum segment length must be positive", __func__);
1700 for (i = 1; i < pa_in->
npoints; i++)
1714 if (d > max_seg_length)
double sphere_distance(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e)
Given two points on a unit sphere, calculate their distance apart in radians.
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
Point in spherical coordinates on the world.
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int allow_duplicates)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE, then a duplicate point will not be added.
#define LW_TRUE
Return types for functions with status returns.
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesion coordinates on unit sphere.
int ptarray_has_m(const POINTARRAY *pa)
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
int ptarray_has_z(const POINTARRAY *pa)
static int ptarray_segmentize_sphere_edge_recursive(const POINT3D *p1, const POINT3D *p2, const POINT4D *v1, const POINT4D *v2, double d, double max_seg_length, POINTARRAY *pa)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)
int p4d_same(const POINT4D *p1, const POINT4D *p2)