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.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | af15df0be01a76dc475cfcfdc91a6b2b8de91301dea42a2bd6eeb161fe4738f7 |
|
MD5 | 0c60c750e6d5d78fea3a8602632e9b91 |
|
BLAKE2b-256 | 67a66e15bfeead56a14b133ef8e20f437a79053e326bcd43ebf39559f5cbdeef |
Close
Hashes for polars_reverse_geocode-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3eae25d051bd506c60bbcbd123e900d71809781e17713b9f2d253d56b4e9f9f |
|
MD5 | ba4649f3f7dd6e96d6bb26e2f10789b5 |
|
BLAKE2b-256 | 2cfb2e9080fabf5855f6187d1f2092319fe12a509663ddf3cab5a1a504591122 |
Close
Hashes for polars_reverse_geocode-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d74e5e48e5c7941cdf46eb139428954965db61467006b17929debaa70e60e6ef |
|
MD5 | ce2a2d140ed6452a2b0f9a769178f524 |
|
BLAKE2b-256 | ff7a4aa47652538bac782a1a3b7068d90185e10074b818131f190621e3a40cc0 |
Close
Hashes for polars_reverse_geocode-0.5.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 401524d96eac30f78f8181be15bd704266f7ab0212328f243d7c3bbedeb386a7 |
|
MD5 | ecb8491f4ac11e9128278b516ec8936e |
|
BLAKE2b-256 | fb920b7eca69257457de60b05d09a11838ef81bb64a988f5a979232797965935 |
Close
Hashes for polars_reverse_geocode-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 189a2fb79ac9001aeb8d1685e56503014ba958c6b014f1648da9a3e53a96233c |
|
MD5 | 1c6799d812e1a39cdb991311828ee410 |
|
BLAKE2b-256 | 16026f16f69cb87dc6607eabc6a806e293208d5375ee6d9964a79c5315097d38 |