libpysal.cg.fast_threshold

libpysal.cg.fast_threshold(pts, dist, radius=6371.0)[source]

Find all neighbors on a sphere within a threshold distance.

Parameters:
pointslistlist

A list of lat-lon tuples. This must be a list, even for one point.

dist: float

The threshold distance.

radiusfloat

The radius of a sphere. Default is Earth’s radius in kilometers, RADIUS_EARTH_KM (6371.0). Earth’s radius in miles, RADIUS_EARTH_MILES (3958.76) is also an option. Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html

Returns:
wddict

A neighbor distance lookup where the key is the ID of a point and the value is a list of IDs for other points within dist of the key point,