Create a new point array with no segment longer than the input segment length (expressed in radians!)
1696 lwerror(
"%s: null input pointarray", __func__);
1697 if ( max_seg_length <= 0.0 )
1698 lwerror(
"%s: maximum segment length must be positive", __func__);
1704 for (i = 1; i < pa_in->
npoints; i++)
1718 if (d > max_seg_length)
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
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,...
#define LW_TRUE
Return types for functions with status returns.
int p4d_same(const POINT4D *p1, const POINT4D *p2)
int ptarray_has_z(const POINTARRAY *pa)
int ptarray_has_m(const POINTARRAY *pa)
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
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)
double sphere_distance(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e)
Given two points on a unit sphere, calculate their distance apart in radians.
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesian coordinates on unit sphere.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Point in spherical coordinates on the world.