访问openstreepmap overpass api的python包装器

overpy2的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=3.4
  • 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需要帮助在这个程序中查找错误,编译但不是计算机所必需的数字   java Androidsocket连接被拒绝   java在单元测试中使用Intent类   sql server 2008换行转义序列在Java中没有以正确的方式回避   嵌入十六进制编码的unicode Java字符串   java无法为类实现tester程序   为json字符串创建通用java映射器   java如何将2个TextView与Android中的if-else条件放在同一位置   java如何初始化锁?   为什么我的多项式类加法函数不起作用?   java Intellij不使用库构建JavaFX   java为什么在EJB类上同时使用@LocalBean和接口?   java无法在Spring Security中登录   Java中的文件创建   运行servlet需要哪个JRE。。服务器JRE还是客户端JRE?   来自Windows命令行的SOAP Web服务中的java SSL证书问题   java JPA如何为实体实施OneOnOne关系?