I wish to create some statistic about a distance from different places in a city to the nearest bus station. For this, naturally, I need to check if a certain point is related to a street or not. I intend to do this via a python script, but I don't really know how to approach this. I know python fairly way, and I was hoping to use a python API rather than learning an entire API from scratch for a hobby project. Any pointers? asked 16 Nov '14, 16:06 Yotam aseerel4c26 ♦ |
You will likely not get around understanding the OSM data model regardless of which API you use. Given that the model is actually very simple that should not be a problem. The See http://wiki.openstreetmap.org/wiki/Elements http://wiki.openstreetmap.org/wiki/API_v0.6 specifically for your problem see the "Ways for node" call. A possible python API is http://wiki.openstreetmap.org/wiki/Osmapi That was the good news. The bad news is that you are problably setting about this completely wrong. If this is any more than a very very low volume cursory check you want to do, you should not try to do this via the editing API in the first place. Particularly if this is something you want to do on a regular base you will want to import osm data in to a suitable database schema and perform queries on that database. Potentially (your question is not quite clear about what kind of distance you are trying to determine, straight line or an actual route on the road/way network) you should be doing this with a routing service/api see for example the accessibility analysis on http://openrouteservice.org/ . If you give some more information on what you are actually trying to acheive, we can probably give some more pointers. answered 16 Nov '14, 22:01 SimonPoole ♦ Hi. Thanks for the replay. My initial though was to create a heat map of my city that show how far is a certain address from the nearest bus stop. I now think that maybe graph that shows the number of houses as a function of distance from the nearest bus stop would be good too. If I could harvest data about bus frequency at each stop, I would factor that in too. But that is not a priority for me. Note that I have a (hebrew) list of streets in my city, but not house numbers.
(17 Nov '14, 09:13)
Yotam
|
According to the OSM wiki about Overpass_API there is a python wrapper for queries: This leads you to https://github.com/mvexel/overpass-api-python-wrapper answered 17 Nov '14, 05:48 stephan75 |