1840 int use_sphere = (s->
a == s->
b ? 1 : 0);
1861 else if ( distance < 0.95 * tolerance )
1896 for ( i = 1; i < pa_many->
npoints; i++ )
1910 if ( d < tolerance )
1918 else if ( d < tolerance * 0.95 )
1927 if ( d < tolerance )
1950 for ( i = 1; i < pa1->
npoints; i++ )
1961 for ( j = 1; j < pa2->
npoints; j++ )
1976 LWDEBUG(4,
"edge intersection! returning 0.0");
1980 LWDEBUGF(4,
"got edge_distance_to_edge %.8g", d);
1988 if ( d < tolerance )
1997 if ( d < tolerance )
2012 LWDEBUGF(4,
"finished all loops, returning %.8g", distance);
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 edge_distance_to_edge(const GEOGRAPHIC_EDGE *e1, const GEOGRAPHIC_EDGE *e2, GEOGRAPHIC_POINT *closest1, GEOGRAPHIC_POINT *closest2)
Calculate the distance between two edges.
Two-point great circle segment from a to b.
#define LWDEBUG(level, msg)
#define LW_ON_INTERRUPT(x)
Point in spherical coordinates on the world.
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, int n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from...
double edge_distance_to_point(const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *gp, GEOGRAPHIC_POINT *closest)
Datum distance(PG_FUNCTION_ARGS)
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesion coordinates on unit sphere.
int edge_intersects(const POINT3D *A1, const POINT3D *A2, const POINT3D *B1, const POINT3D *B2)
Returns non-zero if edges A and B interact.
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
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.
#define LWDEBUGF(level, msg,...)