No project description provided
Project description
Polars-Reverse-Geocode
Polars plugin based on https://github.com/gx0r/rrgeo.
rrgeo takes a latitude and longitude as input and returns the closest city, country, latitude, and longitude, using a k-d tree to efficiently find the nearest neighbour based on a known list of locations. This can be useful if you need to reverse geocode a large number of coordinates quickly, or just need the rough location of coordinates but don't want the expense or complication of an online reverse geocoder.
Installation
pip install polars-reverse-geocode
Usage example
import polars as pl
from polars_reverse_geocode import find_closest_city
df = pl.DataFrame({
'lat': [37.7749, 51.01, 52.5],
'lon': [-122.4194, -3.9, -.91]
})
print(df.with_columns(city=find_closest_city('lat', 'lon')))
shape: (3, 3)
┌─────────┬───────────┬───────────────────┐
│ lat ┆ lon ┆ city │
│ --- ┆ --- ┆ --- │
│ f64 ┆ f64 ┆ str │
╞═════════╪═══════════╪═══════════════════╡
│ 37.7749 ┆ -122.4194 ┆ San Francisco │
│ 51.01 ┆ -3.9 ┆ South Molton │
│ 52.5 ┆ -0.91 ┆ Market Harborough │
└─────────┴───────────┴───────────────────┘
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 Distributions
Close
Hashes for polars_reverse_geocode-0.4.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b55fe35edde6999fe1cb8966ffe9b7854677723b39558187f951cce3f25ae1e7 |
|
MD5 | 6e35ec8d5a4efc2b455aa344c622a7cf |
|
BLAKE2b-256 | 84ccf6755f85c5a998342056dea22c25c688808ac0abfe97531e0082e4ba27df |
Close
Hashes for polars_reverse_geocode-0.4.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f85505b2716678836d05f16e456f0725050559cbb8daf357b1b4e97467b3cfe7 |
|
MD5 | a82df8f615ca42ce5b6e218c446daa27 |
|
BLAKE2b-256 | d201629f7b011aaa2f830c70f281ab64f70ef5743124b6dfd716ec09f4e776bd |
Close
Hashes for polars_reverse_geocode-0.4.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf6a3faf74e9beb511540f68006e7c9c4988a8bb496f93840d15d7b955060be7 |
|
MD5 | 1646fb0435233059dcb55fc4d46a7aba |
|
BLAKE2b-256 | fe620a39200fd4ed3a4b0dade2a221316ae1c8947241f57cbe06bb22a1f17722 |
Close
Hashes for polars_reverse_geocode-0.4.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5688794eed93189a95784524076867533c6bb3246572dd37464a30f45063c7e |
|
MD5 | 77b5a7d101c609b05004f14a694fab9e |
|
BLAKE2b-256 | bd0c1f5136bf009ffc2edeaa4061211f295665ac4e91dd24e1346551a6405564 |
Close
Hashes for polars_reverse_geocode-0.4.2-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b355383519c0c20b7bf5da94032fbb6b88d0635b9887f70d46c8411f53f470c |
|
MD5 | 64908356d0bc588f3018a56929e0326c |
|
BLAKE2b-256 | a2992dfde6426978c4908fbcf7cff3cae05e3af4be8878c45ec89b7e08f63420 |