NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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's gravatar image

ALMSRJ
1112
accept rate: 0%

Can i do that only with OSM? I mean, from a point, get the begining and the and of a street?

(07 Aug '12, 15:52) ALMSRJ
1

Here we help people using OSM, not Google....

(09 Aug '12, 09:41) Pieren

To highlight a street, you can use Overpass API.

The link

http://overpass-api.de/api/convert?data=(way[name~"Im Tannenbusch"](50.6,7.0,50.8,7.3);>;);out skel;target=openlayers

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.

permanent link

answered 08 Aug '12, 07:47

Roland%20Olbricht's gravatar image

Roland Olbricht
6.7k36489
accept rate: 36%

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.

permanent link

answered 07 Aug '12, 17:22

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×142
×24

question asked: 07 Aug '12, 13:05

question was seen: 8,079 times

last updated: 09 Aug '12, 09:41

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum