Nearest neighbor search on Earth's surface with a GPU
Project description
Vincenty nearest neighbor search using CUDA
Nearest neighbor search algorithm on Earth's surface that runs on a GPU and uses Vincenty's formula
Application
Nearest Neighbour Search is the key component of location data analysis:
- Nearest Neighbour Index is based on measuring distances between points
- Both global pattern analysis algorithms (Global Moran’s I, Getis-Ord General G), as well as local pattern analysis algorithms (Anselin Local Moran's I, Getis Ord GI *) with the k-nn approach to define neighbours are based on measuring distances between points
Using Vincenty’s formula allows performing location analysis on any location using geographic coordinates.
Requirements
- CUDA-enabled GPU with compute capability 2.0 or above with an up-to-data Nvidia driver.
- CUDA toolkit
Installation
pip install vincenty-cuda-nns
Usage example
import geopandas as gpd
from vincenty_cuda_nns import CudaTree
df = gpd.read_file('points.geojson')
# data is array of points like [longitude, latitude]
data = np.stack(df['geometry']).astype(np.float32)
# build tree for the data
cuda_tree = CudaTree(data, leaf_size=4)
# query over the tree for nearest neighbor (including itself)
distances, indices = cuda_tree.query(n_neighbors=2)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for vincenty_cuda_nns-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b461afd32bd8580dfb64fe1981130169efeaa1f50d37407cfa021bccc76a7f4 |
|
MD5 | 7b50b42f10ea3728da74265d5e3f8ae6 |
|
BLAKE2b-256 | ba0979efccf96c640d7796c6b5a08dbd48d6807b2e126f7d738cf2026377e6ef |