get speed limits from OpenStreetMap

后端 未结 3 1331
不知归路
不知归路 2021-02-05 18:39

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 determi

3条回答
  •  太阳男子
    2021-02-05 19:25

    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:

    
      
      
    
    
      
    
    ...
    
      
    ...
      
      
      
      
      
    
    

    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.

提交回复
热议问题