Return the part of a line between two fractional locations.
117 double length, slength, tlength;
119 uint32_t srid = lwline->
srid;
134 from = length * from;
140 for (i = 0; i < nsegs; i++)
157 if (fabs ( from - ( tlength + slength ) ) <= tolerance)
164 else if (fabs(from - tlength) <= tolerance)
178 else if (from > tlength + slength)
185 dseg = (from - tlength) / slength;
196 if (fabs(to - ( tlength + slength ) ) <= tolerance )
205 else if (fabs(to - tlength) <= tolerance)
214 else if (to > tlength + slength)
223 else if (to < tlength + slength )
225 dseg = (to - tlength) / slength;
234 memcpy(&p1, &p2,
sizeof(
POINT4D));
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
#define FLAGS_GET_Z(flags)
LWLINE * lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
LWPOINT * lwpoint_construct(int32_t srid, GBOX *bbox, POINTARRAY *point)
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
#define FLAGS_GET_M(flags)
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,...
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
double ptarray_length_spheroid(const POINTARRAY *pa, const SPHEROID *s)
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,...
static void interpolate_point4d_spheroid(const POINT4D *p1, const POINT4D *p2, POINT4D *p, const SPHEROID *s, double f)
Find interpolation point p between geography points p1 and p2 so that the len(p1,p) == len(p1,...
Point in spherical coordinates on the world.