Hi friends! I have a address already geocoded, and i need draw entire street in the map. I think to get the first and the last point of this street and pass to GoogleDirections to calculate this route. How can i get this points or do some like that? Thanks, Andre Silva asked 07 Aug '12, 13:05 ALMSRJ |
To highlight a street, you can use Overpass API. The link for example, highlights the street "Im Tannenbusch" within the rough bounding box north 50.6, east 7.0, north 50.8, east 7.3. The link also shows that the question about the first and last point of a street is not so simple: there are three ends to that street. Other streets may have much more endings or even none at all if the street is circular. So a search for the first and the last point cannot be more than heuristics. In general, you can get the raw data for a street with a link similar to the above http://overpass-api.de/api/interpreter?data=(way[name~"Im Tannenbusch"](50.6,7.0,50.8,7.3);>;);out; This raw data consists of the ways that comprise the street within the "way" tags. The "nd" tags correspond to the referred nodes (points). In this raw data you can look which of the first or last lines starting with "<nd" within a way-tag appears only once. These ids are the nodes at all the possibly multiple ends of a street. answered 08 Aug '12, 07:47 Roland Olbricht |
Any basic frameworks about routing with OSM data can be found in the OSM wiki about Routing But you have to define first how you will find the start and end node of a street, because one street can consist of several ways. So tell us by adding a COMMENT here how you will define this. answered 07 Aug '12, 17:22 stephan75 |
Can i do that only with OSM? I mean, from a point, get the begining and the and of a street?
Here we help people using OSM, not Google....