使用python实现地理位置查询经纬度 您所在的位置:网站首页 用经纬度查询地理位置怎么查 使用python实现地理位置查询经纬度

使用python实现地理位置查询经纬度

2024-07-12 21:36| 来源: 网络整理| 查看: 265

地理编码工具geocoder

地理编码工具geocoder,不同厂商的服务整合统一起来 地理编码

import geocoder g = geocoder.google("1403 Washington Ave, New Orleans, LA 70130") g = geocoder.arcgis(u"北京市海淀区上地十街10号") g.latlng

输出为

[29.9287839, -90.08421849999999]

也可以查看完整的geojson

g.geojson

逆地理编码

#可以换成arcgis的服务试试 g = geocoder.google([29.9287839, -90.08421849999999], method='reverse') print g print g.address print g.city print g.state print g.country

geocoder 的功能不止于此,它还可以查IP(包括自己的)

g = geocoder.ip('199.7.157.0') print g.latlng print g.city g = geocoder.ip('me') print g.latlng print g.city


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有