Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polars_reverse_geocode-0.4.4.tar.gz (20.4 kB view details)

Uploaded Source

Built Distributions

polars_reverse_geocode-0.4.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

polars_reverse_geocode-0.4.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.9 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

polars_reverse_geocode-0.4.4-cp38-abi3-macosx_11_0_arm64.whl (5.3 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

polars_reverse_geocode-0.4.4-cp38-abi3-macosx_10_12_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

Details for the file polars_reverse_geocode-0.4.4.tar.gz.

File metadata

File hashes

Hashes for polars_reverse_geocode-0.4.4.tar.gz
Algorithm Hash digest
SHA256 733131b0547558124c267d32a78886d843886e241f9f26fb44cdeaf7dacc2198
MD5 a01506d2106d5b24da5b5fa78427c3b9
BLAKE2b-256 1f82d00d755aa1736145b60f7d69d137dc8495c71a26a392b0eb7335827888b6

See more details on using hashes here.

File details

Details for the file polars_reverse_geocode-0.4.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polars_reverse_geocode-0.4.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 82e24f7fec41d623bca9114ab4483141887cca5f50147e062f1d1f950f9a591b
MD5 9b00ccf37b8af4a569e476280e5051b3
BLAKE2b-256 1fed21334e9f33c81bbf11771bc7047aa6973269df14ea12bdef41b2b3def0e0

See more details on using hashes here.

File details

Details for the file polars_reverse_geocode-0.4.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for polars_reverse_geocode-0.4.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e2018b9b10d70a2fba9f507e692862c0560f47f4512ad4c1f4e6cb75d2aa88fd
MD5 2e83ec1083f2b2ab9358c393e71a4007
BLAKE2b-256 7784da8f521c406c644e28529ca940b30c0891fdf6ad768806f54a7ec7a761a7

See more details on using hashes here.

File details

Details for the file polars_reverse_geocode-0.4.4-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polars_reverse_geocode-0.4.4-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 800921f0541739f7dd11425e7d63c0fd76fce9f1372f616371b0a38728c6df05
MD5 8a72f66ea91dd46e7838e655a852ecb0
BLAKE2b-256 8b554f3b44246b4ab0e0c9e143fb6e40bb03cd10633eca2483bb717e440def54

See more details on using hashes here.

File details

Details for the file polars_reverse_geocode-0.4.4-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for polars_reverse_geocode-0.4.4-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 63c93fa5e344f7aba282ab47346375b32bf4bbe5f0fb38c156220125729b5767
MD5 ac745ebe4c1b45a820c8dd86a5b6073c
BLAKE2b-256 817785d234e16ddde470cbb26bb1267e351867940ca14cba0247db8c050865dd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page