从OpenStreetMap获取速度限制 [英] get speed limits from OpenStreetMap

查看:550
本文介绍了从OpenStreetMap获取速度限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个移动应用程序,该应用程序确定某人是否是一个好的驾驶员.手机坐在仪表板上,并在用户驾车时收集GPS信息.我需要确定驱动程序是否遵循速度限制的方式,我想通过OpenStreetMap做到这一点.从OpenStreetMap获取速度限制的最佳方法是什么?

I'm creating a mobile app that determines if someone if a good driver. The phone sits on the dashboard and collects GPS information while the user is driving. I need to determine a way if the driver is following the speed limit, and I would like to do this via OpenStreetMap. What is the best way to get speed limits from OpenStreetMap?

推荐答案

您可以提出Web请求以获取答案.
这是一个应该放在其中的小盒子(尝试作为浏览器URL):

You can make a Web request to get your answer.
Here is one (try it as a browser URL) of a small box where you're supposed to be:

www.overpass-api.de/api/xapi?*[maxspeed=*][bbox=5.6283473,50.5348043,5.6285261,50.534884]

,并显示在学校前面经过这条街的答案:

and the answer showing the street passing through it, in front of a school:

<node id="1312239864" lat="50.5348877" lon="5.6286790">
  <tag k="highway" v="crossing"/>
  <tag k="traffic_calming" v="bump"/>
</node>
<node id="2025084665" lat="50.5345623" lon="5.6274183">
  <tag k="traffic_calming" v="choker"/>
</node>
...
<way id="191950462">
  <nd ref="2025084669"/>
...
  <tag k="bicycle" v="yes"/>
  <tag k="highway" v="secondary"/>
  <tag k="maxspeed" v="30"/>
  <tag k="name" v="Rue d'Esneux"/>
  <tag k="source:maxspeed" v="school zone"/>
</way>

我只留下了有趣的东西,大多数是自我解释.例如,流量缓和功能在其自己的节点上.
街道是由节点和其自己的标签构成的方式.
maxspeed = 30是您的答案.如果没有最大速度, 默认值适用于高速公路=次要公路(或=高速公路...)
所有标签均在wiki.openstreetmap.org中进行了描述
那是使用 xapi .您也可以使用立交桥.
限速覆盖部分,但您可以改善它. 在主地图上留下注释以提供数据.

I only left the interesting stuff in, most self explanatory. For example, traffic calming features on their own node.
The street is the way made of the nodes and of its own tags.
maxspeed=30 is your answer. Should there be no maxspeed, the default applies for highway=secondary (or =motorway ...)
All the tags are described at wiki.openstreetmap.org
That's using xapi. You may also use the overpass api.
Speed limit coverage is partial but you may improve it. Leave Notes on the main map to provide the data.

这篇关于从OpenStreetMap获取速度限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆