Cythonized geodetic and planar distance functions for R-Trees.
Project description
boxdist
Cythonized geodetic and planar distance functions for R-Trees. The implementation is adapted from Tile38, which is based on the paper Geodetic Distance Queries on R-Trees for Indexing Geographic Data.
Geodetic
from boxdist import geodetic_box_dist
targetlon = -72.946472
targetlat = 45.154927
minlon = -74.19342
minlat = 45.265222
maxlon = -73.157959
maxlat = 45.704261
meters = geodetic_box_dist(
targetlon,
targetlat,
minlon,
minlat,
maxlon,
maxlat,
)
meters #=> 20612.892322138163
Planar
from boxdist import planar_box_dist
targetx = 0
targety = 0
minx = 1
miny = 1
maxx = 2
maxy = 2
squared_dist = planar_box_dist(
targetx,
targety,
minx,
miny,
maxx,
maxy,
)
squared_dist #=> 2
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
boxdist-1.3.0.tar.gz
(54.4 kB
view details)
Built Distribution
File details
Details for the file boxdist-1.3.0.tar.gz
.
File metadata
- Download URL: boxdist-1.3.0.tar.gz
- Upload date:
- Size: 54.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b2912840307d3d30710d81850140e791b09be9c8069512e5fc594b328904429 |
|
MD5 | 03a48faf3d04a8d1e7355f789bb6f473 |
|
BLAKE2b-256 | 118ec3c5e54742cdf38b547c6cd65728f5b75a48142786b9131d68282c10ea6c |
File details
Details for the file boxdist-1.3.0-cp310-cp310-macosx_12_0_arm64.whl
.
File metadata
- Download URL: boxdist-1.3.0-cp310-cp310-macosx_12_0_arm64.whl
- Upload date:
- Size: 20.7 kB
- Tags: CPython 3.10, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e7a4cd44861cf60fa00f2a241287476595692e2ef9e52c64e56d90b55c838cc |
|
MD5 | 4e871b886782c17be9a3f4d0f45f0042 |
|
BLAKE2b-256 | a752683d13f3f51bb1cc863b057a82072b57075f13b56c0c40b9b3cb9034b158 |