【Python】使用geopy由地址找经纬度等信息
代码:
from geopy.geocoders import Nominatim
geolocator = Nominatim()
location = geolocator.geocode("大连火车站") # 还得是有名地方。名气小的地方这个API会罢工
print(location.address)
print((location.latitude, location.longitude))
print(location.raw)
输出:
大连火车站, 长江路, 西岗区, 大连市, 甘井子区 / Ganjingzi, 大连市 / Dalian, 辽宁省, 116011, 中国
(38.9199585, 121.6298679)
{', 'boundingbox': ['38.9199085', '38.9200085', '121.6298179', '121.6299179'], 'lat': '38.9199585', 'lon': '121.6298679', 'display_name': '大连火车站, 长江路, 西岗区, 大连市, 甘井子区 / Ganjingzi, 大连市 / Dalian, 辽宁省, 116011, 中国', 'class': 'railway', 'type': 'tram_stop', 'importance': 0.11025, 'icon': 'https://nominatim.openstreetmap.org/images/mapicons/transport_tram_stop.p.20.png'}
另:北京天安门的是
C:\Users\horn1\Desktop\python\50-geopy>python findaddress.py
天安门, 1, 西长安街, 崇文, 北京市, 东城区, 北京市, 100010, 中国
(39.90733345, 116.391244079988)
{', 'boundingbox': ['39.9072273', '39.9075343', '116.3906566', '116.3918428'], 'lat': '39.90733345', 'lon': '116.391244079988', 'display_name': '天安门, 1, 西长安街, 崇文, 北京市, 东城区, 北京市, 100010, 中国', 'class': 'building', 'type': 'yes', 'importance': 0.00025}
2018年5月15日
【Python】使用geopy由地址找经纬度等信息的更多相关文章
- 高德地图api实现地址和经纬度的转换(python)
利用高德地图web服务api实现地理/逆地址编码 api使用具体方法请查看官方文档 文档网址:http://lbs.amap.com/api/webservice/guide/api/georegeo ...
- 个人永久性免费-Excel催化剂功能第92波-地理地址与经纬度互转功能
GPS设备和手机LBS的兴起,在地理信息存储过程中,在程序.应用级别是需要用经纬度去定位,而在数据分析的级别,特别是省市区镇街的分析,用到的是人可识别的文本类型存储,从设备中采集下来的数据和人工维护的 ...
- 基于python实现查询ip地址来源
接口调用方法是在url后面直接加上IP地址. url = 'http://freeapi.ipip.net/218.192.3.42' #中文免费 url2 = 'http://ip-api.com/ ...
- Python 获取 网卡 MAC 地址
/*********************************************************************** * Python 获取 网卡 MAC 地址 * 说明: ...
- 根据地址查询经纬度.html
<html xmlns="http://www.w3.org/1999/xhtml"><head> <title>根据地址查询经纬度</t ...
- 通过崩溃地址找错误行数之Delphi版
通过崩溃地址找错误行数之Delphi版2009-5-11 17:42:35 来源: 转载 作者:网络 访问:360 次 被顶:2 次 字号:[大 中 小]核心提示:什么是 MAP 文件?简单地讲, M ...
- 通过地址获得经纬度(百度Geocoding API)
1.什么是Geocoding? Geocoding API 是一类简单的HTTP接口,用于提供从地址到经纬度坐标或者从经纬度坐标到地址的转换服务,用户可以使用C# .C++.Java等开发语言发送HT ...
- python整数与IP地址转换
python整数与IP地址转换 [转] 我们有时会将一个整数与IP地址进行互换,用python代码实现很简单将一个整数如2000000,变为一个IP地址的方式 >>> import ...
- 根据地址查询经纬度Js
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>根据地址查询经纬度</ ...
随机推荐
- OData查询ASP.NET Web API全攻略
本篇使用ASP.NET Web API来体验OData各种query. 首先是本篇即将用到的Model.使用的OData版本是4.0. public class Customer { public i ...
- delphi时间日期函数
unit DateProcess; interface const DayOfWeekStrings: ..] of String = ('SUNDAY', 'MONDAY', 'TUESDAY', ...
- lufylegend:动画
1.动画1 <script type="text/javascript"> var loader,anime,layer; //初始化画布 init(200, &quo ...
- SpringBoot中Mybatis打印sql
原文:https://www.cnblogs.com/expiator/p/8664977.html 如果使用的是application.properties文件,加入如下配置: logging.le ...
- iOS 内存斗争小史之 NavigationController
1.怎样写一个不泄漏的NavigationController页面跳转程序? 非arc模式下,假设有A.B两个viewController,从A推到B,怎样写内存才能不泄漏? A.m -(IBActi ...
- docker 容器间网络配置
创建一个docker容器,docker系统会自动为该容器分配一个ip地址,通常是172.17开头. 我们可以在主机上用 docker inspect 命令 或者进入容器用ifconfig命令来查看容器 ...
- TK1 设置最大频率
支持的值:cat /sys/kernel/debug/clock/gbus/possible_rates当前值:cat /sys/kernel/debug/clock/gbus/rate 设置最大值: ...
- linux文件去重工具findup, fslint-gui
findup, fslint-gui,图形化工具,直接使用
- Generalized normal distribution and Skew normal distribution
Density Function The Generalized Gaussian density has the following form: where (rho) is the " ...
- vim去除行显示;vim全部复制命令
行显示和隐藏: set nu set nu! 直接上命令: ggVG*y 解释一下上面的命令: ggVG ——全选 *y —— 复制到剪贴板 gg 是光标定位到文件首行 V 是进入可视模式 G ...