I am new to OSM. I have a result of a map-matching algorithm on some trajectory data (GPX) and the returned results are defined as (waypoint id, start node, end node) I want to retrieve the name of the street from the waypoint id? How to do so? For example in Nominatim service the response is in the XML form. But I cannot find a suitable service for getting real names from ids in OSM. I found this: http://www.openstreetmap.org/way/256328760 This page returns the map of way point. But I want the ref name St 2572 And as another question How to get All this data (the data for a city) for educational and research purposes? asked 04 Feb '15, 15:01 Alamdari |
use an OSM API to query this way's data. Do not use the main – editing – API, it is okay for very small tests though. Example URL for the editing API. Example URL for the Overpass API. Now just process the XML as usual to get your desired tag. With Overpass API you also could get other output formats if you do not want XML. For your "data for a city" question: you can use the Overpass API for quite many requests, see its wiki article. Or do you want to download the raw OSM data for a whole city? Please search our question collection for older questions about getting data extracts and ask a new one if you cannot find anything. answered 04 Feb '15, 16:10 aseerel4c26 ♦ As said, you shouldn't use the API for thousands single id requests. Instead, you should download the area into your local disk, either with an editor like JoSM (and the 'save as') or using some planet file extracts (check the wiki to find web sites offering extracts at country or even major city levels). Once you have the data locally, you can find your ref's by different means (manually or by scripts).
(05 Feb '15, 11:21)
Pieren
@Pieren: while getting a data extract could still be the best/most fast solution it is okay to query Overpass API with those requests, if I understand its service description correctly. Maybe Alamdari even means Overpass API, because I have coined my link "an OSM API" which also lists Overpass.
(05 Feb '15, 12:13)
aseerel4c26 ♦
|