GeoKDTree¶
GeoKDTree
¶
A great-circle k-NN / radius index over lat/lon points (EPSG:4326).
The single spatial-join primitive shared by find_nearest_stations,
multimodal and osm. Built on scipy.spatial.cKDTree over a 3-D
unit-sphere embedding, so queries are exact great-circle distances in metres
(no flat-earth error near the poles or the antimeridian).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lat
|
array - like
|
Point coordinates in degrees (EPSG:4326). |
required |
lon
|
array - like
|
Point coordinates in degrees (EPSG:4326). |
required |
See Also
find_nearest_stations : k-nearest queries on this index.
stations_near : Radius queries on this index.
features_within : Buffer joins on this index.
Source code in src/gbfs_toolkit/spatial/geometry.py
query
¶
Nearest k indices and great-circle distances (metres) for each query point.
Source code in src/gbfs_toolkit/spatial/geometry.py
query_radius
¶
query_radius(lat: Any, lon: Any, radius_m: float) -> list[ndarray]
Indices within radius_m great-circle metres of each query point.