访问openstreepmap overpass api的python包装器

overp的Python项目详细描述


访问overpass api的python包装器。

查看documentation以查找其他信息。

Latest VersionLicensehttps://travis-ci.org/DinoTools/python-overpy.svg?branch=masterhttps://coveralls.io/repos/DinoTools/python-overpy/badge.png?branch=master

功能

  • 查询立交桥API
  • 分析json和xml响应数据
  • 其他辅助功能

安装

要求:

支持的Python版本:

  • python 2.7版
  • python=3.2
  • pypy和pypy3

安装:

$ pip install overpy

示例

其他示例可以在documentationexamples目录中找到。

importoverpyapi=overpy.Overpass()# fetch all ways and nodesresult=api.query("""
    way(50.746,7.154,50.748,7.157) ["highway"];
    (._;>;);
    out body;
    """)forwayinresult.ways:print("Name: %s"%way.tags.get("name","n/a"))print("  Highway: %s"%way.tags.get("highway","n/a"))print("  Nodes:")fornodeinway.nodes:print("    Lat: %f, Lon: %f"%(node.lat,node.lon))

助手

帮助器方法可用于提供对常用请求的轻松访问。

importoverpy.helper# 3600062594 is the OSM id of Chemnitz and is the bounding box for the requeststreet=overpy.helper.get_street("Straße der Nationen","3600062594")# this finds an intersection between Straße der Nationen and Carolastraße in Chemnitzintersection=overpy.helper.get_intersection("Straße der Nationen","Carolastraße","3600062594")

许可证

在麻省理工学院出版(更多信息请参见许可证)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在通配符泛型类型和泛型类型之间未经检查的强制转换   java Eclipse SWT Hello world教程:无法将显示解析为类型   java如何向远程用户发送注销消息?   java RDD之后的空文件是什么。保存ASTEXTFILE?   用户界面在java中创建一个htmljs UI GCalendar   Java多个哈希映射指向同一个键   Java Dowhile循环不工作?   oraclejava类。组织。阿帕奇。梁sdk。util。UserCodeException:java。sql。SQLException:无法创建PoolableConnectionFactory   java是org类型。日食用户界面。文本编辑器。*看不见   java有没有从弹出窗口复制eclipse中变量值的插件或快捷方式?   java getSubimage为我提供了期望值null   java我想让它变得更简单   swing AWTEventQueue0一直在运行,java中的程序变得非常慢   java Solr实例化类时出错:自定义类   java将ListView适配器移植到RecyclerView适配器   c#测试混合web和桌面应用程序的安全性