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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26ca993bdf347fc566e1ca9c2cd2ba4f7b9accffdc835899ea475c72292e9a3a |
|
MD5 | b24dbd91eb090216163f69a22198a808 |
|
BLAKE2b-256 | f6a5eb5872afb6a574c96d8a96c5674c4537d14f6255818b9286ca3dfe1c5a16 |
Close
Hashes for polars_reverse_geocode-0.4.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7210e76369812f07c578a3751d7870720b1bbefa2e45ed66e341010d0684b530 |
|
MD5 | ff52fa8f79d8bc1b58767bbd5d133236 |
|
BLAKE2b-256 | abe763c43e905e9d8d172c095f0a4daf07042c07829f6e3388c25f4b72a4ad4f |
Close
Hashes for polars_reverse_geocode-0.4.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c9886ca8dc267e51f8eb2f8c31f85ef87a811f7b87a223df0ac44b3669d24c1 |
|
MD5 | 3230f9f703684cb645821edbc467bf61 |
|
BLAKE2b-256 | 5c4886cba828f5cb5dce26ec130c3e702d023b619ad7bbe7df14d963765651e7 |
Close
Hashes for polars_reverse_geocode-0.4.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a092f624f5d40bcb039fe349cd4d00313ee374c4c6a733a744b0d0cd5384267 |
|
MD5 | f509389470be6c910408dab744ab15c4 |
|
BLAKE2b-256 | 856d7e83069db83f5e85e5eae7e98586a6b2e0b4534797130f668bf909900472 |
Close
Hashes for polars_reverse_geocode-0.4.1-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6be69491b9e01e47a1c81f0f353c26730dcbd0ad703fc816bd3d00a60c197721 |
|
MD5 | f54d09fda4c404de71105323c8695ce8 |
|
BLAKE2b-256 | 7049f460cc92a78054f3d13c3f65b6d99b437ed69a7a8202039c89d2e42bba3b |