跳转到主要内容

未提供项目描述

项目描述

Polars-Reverse-Geocode

基于 https://github.com/gx0r/rrgeo 的 Polars 插件。

rrgeo 接收纬度和经度作为输入,并使用 k-d 树根据已知位置列表高效地找到最近邻,从而返回最接近的城市、国家、纬度和经度。如果您需要快速地对大量坐标进行反向地理编码,或者只需要坐标的大致位置,而不想使用在线反向地理编码器的费用或复杂性,这将非常有用。

安装

pip install polars-reverse-geocode

使用示例

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 │
└─────────┴───────────┴───────────────────┘

项目详情


下载文件

下载您平台上的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分布

polars_reverse_geocode-0.6.0.tar.gz (19.6 kB 查看哈希)

上传时间:

构建分布

polars_reverse_geocode-0.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.0 MB 查看哈希)

上传于 CPython 3.8+ manylinux: glibc 2.17+ x86-64

polars_reverse_geocode-0.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.8 MB 查看哈希)

上传于 CPython 3.8+ manylinux: glibc 2.17+ ARM64

polars_reverse_geocode-0.6.0-cp38-abi3-macosx_11_0_arm64.whl (5.4 MB 查看哈希)

上传于 CPython 3.8+ macOS 11.0+ ARM64

polars_reverse_geocode-0.6.0-cp38-abi3-macosx_10_12_x86_64.whl (5.6 MB 查看哈希)

上传于 CPython 3.8+ macOS 10.12+ x86-64

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面