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.6.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cba8fd6ed4055834152c815d3a68bd575a2101e443efa79aa5e0a9da90891afb |
|
MD5 | 6a9d5d99de4addd62c5d9ea1e2e680c0 |
|
BLAKE2b-256 | 515754093f150535c70d6d113888501cb69c979a0f997d20fe3b5e7224c25f35 |
Close
Hashes for polars_reverse_geocode-0.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 985e42e01fbde97515c28c2f29a3d7f50895ebadafce59b9dcbb5bef21d2a9a3 |
|
MD5 | f653278f2371ecc723c6960d755776e5 |
|
BLAKE2b-256 | 20ec69d667222054a35b3e15b5c10343e7451f2170085ccb840778b4acf77b8b |
Close
Hashes for polars_reverse_geocode-0.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76eabdb64b08bc548801f7373998b2e6f8159166587ea96c961488225d6b1a46 |
|
MD5 | 3a27b5189efd7b434f7ce353d95444b0 |
|
BLAKE2b-256 | e51448350a8b87ed56383eb087c0cefdbff59324f9976ea03133629c73883c3c |
Close
Hashes for polars_reverse_geocode-0.6.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29e61045db14d54f4468ab0908eb64b662793af1837340884955d7ae21569604 |
|
MD5 | e5073664c293717ecf7ba54f427faca5 |
|
BLAKE2b-256 | f6e60c21e4c17abc838b4766aa880e142488e1968b19714f6ef6501a59452e36 |
Close
Hashes for polars_reverse_geocode-0.6.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89e1b92e5999eead1248ff067b291d49be57b9dac31e567a0e726110c6d10136 |
|
MD5 | a7c6cab8d6a33b9b45421cdb76b1f172 |
|
BLAKE2b-256 | a4e1c58ada829ed88a8dec4040188732f253d07e0990ce3e279b06499d788e78 |