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 reverse_geocode
df = pl.DataFrame({
'lat': [37.7749, 51.01, 52.5],
'lon': [-122.4194, -3.9, -.91]
})
print(df.with_columns(city=reverse_geocode('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.3.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35eed918fe4841e4b94bee44bd04063ee7aa2700c930e37c79e78dd055a8fd0a |
|
MD5 | 566e36272665e2f0c796eb3d8d50f3cb |
|
BLAKE2b-256 | 96e7415081c47bcdbf15554538c1a30e31bfc596659542906b43af48ca16de41 |
Close
Hashes for polars_reverse_geocode-0.3.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4901e2999fd929e6158d650aaeb3758d6e551353b1212b992e7a807cd046d395 |
|
MD5 | eaf68bcf36cecb0f1f129b9cbc7702eb |
|
BLAKE2b-256 | 558e4cc2bb9c056a20d175b452af3dcad695abe182fffd9259c190b7928fa592 |
Close
Hashes for polars_reverse_geocode-0.3.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 588a2816d9712735973f37a8883dbb71212b70a7c61ae3364fd148b730759bbd |
|
MD5 | ceaef32661042c8fb9b9cf17a4d65c19 |
|
BLAKE2b-256 | 9c24abc775781a812da7674907b2fd5b54a9b0efed796eeb39e4221bc8bfb9a9 |
Close
Hashes for polars_reverse_geocode-0.3.4-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edb773e8d70f4f3b5ae7752c623226188a4de9b73d8460af8dc482c077bc2f4c |
|
MD5 | f722ad21efd31fd5a29cc6408731f7b6 |
|
BLAKE2b-256 | 8b2a3388b2d867f89a28d59847b4ff7d694a9250ec20570e4e1f2864eeb18d51 |
Close
Hashes for polars_reverse_geocode-0.3.4-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70aa0d53ff8a482501dc29c428782cecec560ebaab2dc8b02904cf1d2bdb922c |
|
MD5 | 786da04f6f95c52af1c887cd5f2cbca5 |
|
BLAKE2b-256 | 27d89dd13b89a5cf21afea2db6ccc60f69f151f6939bbe0636415290af12439e |