get geocoding with geopy from baidu and bing
2015-01-30 17:50
931 查看
h1. 准备工作
安装pytyon, pip, geopy
> wget -N https://bootstrap.pypa.io/get-pip.py
> python get-pip.py
> pip install geopy pygeoip
h2. 百度地图
编写如下 gbaidu.py 脚本
>python gbaidu.py
h2. 必应地图
编写如下gbing.py脚本
>python gbing.py
参考链接
1. http://blog.csdn.net/killmice/article/details/8633606
2. http://code.xster.net/pygeocoder/wiki/Home
3. http://dev.maxmind.com/geoip/legacy/geolite/
4. http://developer.baidu.com/map/index.php?title=webapi/guide/webservice-geocoding
5. http://stackoverflow.com/questions/373383/geocoding-libraries
6. https://github.com/geopy/geopy
目前上面两个脚本都没有结果,相信不是网速的原因,谁能翻墙帮我试一下。
安装pytyon, pip, geopy
> wget -N https://bootstrap.pypa.io/get-pip.py
> python get-pip.py
> pip install geopy pygeoip
h2. 百度地图
编写如下 gbaidu.py 脚本
# -*- coding: utf-8 -*- #!/usr/bin/python from geopy.geocoders import baidu apikey = '1234567' #从网站申请 http://lbsyun.baidu.com/apiconsole/key?application=key g = baidu.Baidu(apikey) print 'query demo' a = g.geocode("上海市 人民广场") print(a.latitude,a.longitude) b = g.reverse("31.236004921296, 121.47894508654") print b.address
>python gbaidu.py
h2. 必应地图
编写如下gbing.py脚本
# -*- coding: utf-8 -*- #!/usr/bin/python from geopy.geocoders import bing ak = '1234567' #从网站申请 https://msdn.microsoft.com/en-us/library/ff428642.aspx#keyMigration g = bing.Bing(ak) print 'query demo' a = g.geocode("上海市 人民广场") print(a.latitude,a.longitude) b = g.reverse("31.236004921296, 121.47894508654") print b.address
>python gbing.py
参考链接
1. http://blog.csdn.net/killmice/article/details/8633606
2. http://code.xster.net/pygeocoder/wiki/Home
3. http://dev.maxmind.com/geoip/legacy/geolite/
4. http://developer.baidu.com/map/index.php?title=webapi/guide/webservice-geocoding
5. http://stackoverflow.com/questions/373383/geocoding-libraries
6. https://github.com/geopy/geopy
目前上面两个脚本都没有结果,相信不是网速的原因,谁能翻墙帮我试一下。
相关文章推荐
- [转]How to get return values and output values from a stored procedure with EF Core?
- get_info_from_baiduzhidao_via_xmlhttp_and_adodb
- A Taste of AOP from Solving Problems with OOP and Design Patterns (Part II)
- [导入]A Taste of AOP from Solving Problems with OOP and Design Patterns (Part I)
- Beginning Google Maps Applications with Rails and Ajax From Novice to Professional - Chapter One
- Beginning Google Maps Applications with Rails and Ajax: From Novice to Professional
- CWaveFile -- a Class for Working with and Representing Data from WAVEs
- Getting Started with Java and Bluetooth (From www.java.net)
- Learning C# 2005 : Get Started with C# 2.0 and .NET Programming
- Get phone and email from page
- A Taste of AOP from Solving Problems with OOP and Design Patterns (Part II)
- [导入]A Taste of AOP from Solving Problems with OOP and Design Patterns (Part I)
- A Taste of AOP from Solving Problems with OOP and Design Patterns (Part III) zz
- A Taste of AOP from Solving Problems with OOP and Design Patterns (Part III)
- Get number from string with regular expression in java
- A Taste of AOP from Solving Problems with OOP and Design Patterns (Part I)
- [导入]A Taste of AOP from Solving Problems with OOP and Design Patterns (Part I)
- 利用webservice和.net技术上传和下载文件--Sending files in chunks with MTOM Web Services and .NET 2.0 from:http://www.codeproject.com/soap/MTO
- How to use GET and POST methods in HTTP from a MIDlet
- Beginning JavaScript with DOM Scripting and Ajax: From Novice to Professional