I am a bit lost and I am hoping that someone will help me start and hopefully help others as well. My requirements are pretty straightforward. I want to download raw data for the:
For example:
For this I understand that I first have to download a .osm file and then read the data with a parser. However, that just seems really vague to me. The documentation seems a bit confusing and not straightforward to me. So I wanna ask, how can I download the data mentioned above for a specific country or city ? (I want to download the data of Athens). Then the next question is what file format will those data be in ? and how will I extract the above information from that file ? asked 16 Mar '16, 02:42 shiro900 |
Sorry I'm little bit late, but you can use this software answered 08 Jun '17, 13:41 vanhapanda |
You can get city specific datasets e.g. at mapzen, e.g. OSM XML format for Athens. There you have all the nodes of the city. Read about the OSM XML file format. Write a script in your favourite programming language to parse this, extract the nodes that you need, calculate the distance and write out the list format (CSV, whatever) that you need. For geographical distance calculations, you need an appropriate geo library, e.g. Proj. I can’t help you with that, it’s over my head. Another approach might be feeding the data into a geo enabled database like PostGIS und use its functions. answered 16 Mar '16, 03:50 Hraban For topology - whether nodes are connected by a line or not - you will have to evaluate the "way" objects as well. For distance in meters, use your favourite search engine to dig up the Haversine Formula.
(16 Mar '16, 06:40)
Frederik Ramm ♦
@FrederikRamm I am just surprised that there is no official library or instructions with examples on how to do that.
(16 Mar '16, 06:57)
shiro900
1
There's tons of open source routing engines (routino, osrm, graphhopper, osm2pgrouting, ...) where you can look at how it's done. Extracting a graph from OSM data is a very specific requirement that rarely occurs outside of routing engines. There's a couple good general OSM processing libraries (eg Osmium and its Javacript and Python bindings) but that only helps you with parsing, you'll still have to build the kind of graph you want yourself.
(16 Mar '16, 07:51)
Frederik Ramm ♦
|