1844 int use_sphere = (
s->a ==
s->b ? 1 : 0);
1865 else if (
distance < 0.95 * tolerance )
1900 for ( i = 1; i < pa_many->
npoints; i++ )
1914 if ( d < tolerance )
1922 else if ( d < tolerance * 0.95 )
1931 if ( d < tolerance )
1954 for ( i = 1; i < pa1->
npoints; i++ )
1965 for ( j = 1; j < pa2->
npoints; j++ )
1980 LWDEBUG(4,
"edge intersection! returning 0.0");
1984 LWDEBUGF(4,
"got edge_distance_to_edge %.8g", d);
1992 if ( d < tolerance )
2001 if ( d < tolerance )
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
#define LW_ON_INTERRUPT(x)
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.
uint32_t edge_intersects(const POINT3D *A1, const POINT3D *A2, const POINT3D *B1, const POINT3D *B2)
Returns non-zero if edges A and B interact.
double edge_distance_to_point(const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *gp, GEOGRAPHIC_POINT *closest)
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesian coordinates on unit sphere.
double edge_distance_to_edge(const GEOGRAPHIC_EDGE *e1, const GEOGRAPHIC_EDGE *e2, GEOGRAPHIC_POINT *closest1, GEOGRAPHIC_POINT *closest2)
Calculate the distance between two edges.
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.
Datum distance(PG_FUNCTION_ARGS)
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
Two-point great circle segment from a to b.
Point in spherical coordinates on the world.