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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 294019fe3de18b24fe852b77b027fbe061ac0c03770b0b035b941424a5acfcc2 |
|
MD5 | 8ea40e1c58fe6a287a5e4e1adcab869a |
|
BLAKE2b-256 | d6f4ef779a02c362f5c5f3a30a9a8f9bf3b804389424a9b5203547c0e42c4515 |
Close
Hashes for polars_reverse_geocode-0.4.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12ccb76100573ab3bd3b7277e118c2195be0d9775aea2772df7955d3df232e98 |
|
MD5 | 1b9dc85259f2b9259ea44cb69ebc5dc0 |
|
BLAKE2b-256 | 2448e39cfac3c1899adfbe07fa4ff785d984930bcd94977c8ef109a9aab1c760 |
Close
Hashes for polars_reverse_geocode-0.4.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe4091be80a94130720c8a89eca48162c33dc8a8248d0d7923fcfb271b8f74f0 |
|
MD5 | e2eb97308d0cbbd08592c0446873c4f9 |
|
BLAKE2b-256 | 6a4051eae0b3acbfdf23dea5c1c93c75790df478c76451570387e190e0ffa710 |
Close
Hashes for polars_reverse_geocode-0.4.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1917f127e44bc23ebcaf96225211e5b596aa3c3a910af2d0563e37951baeaeee |
|
MD5 | 4542ae28c8db191b0ad34e3c016b4006 |
|
BLAKE2b-256 | 88ce4fa049c5f4d20fe8fed5f96c500e29c1e87ad0f5be59f621bcfb907518ef |
Close
Hashes for polars_reverse_geocode-0.4.3-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66d87c0269c741aaaa0115a07f051353bf8f3811f05f91bd60ceb1ef098761f1 |
|
MD5 | c366e333c3fdb56a623c30684212d734 |
|
BLAKE2b-256 | feee7a6fe04bfb207be724e5b719d51c3ea38983573d8d588a1582740f6f3a00 |