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

Hey there,

I'm new with the OSM API and I am trying to work with the data retrieved via GetMapData and a BoundingBox. There are <way> Elements in the retrieved data that describe streets - so far so clear.

The question according to my title: How can I detect which roads intersect, or rather how to get the points where they intersect? I tried to search for common nodes, but that didn't work. So I wonder if there is anything I haven't found yet to do this job..

asked 05 Dec '11, 21:01

raveNOSM's gravatar image

raveNOSM
1112
accept rate: 0%


First of all, the API queries - and GetMapData seems to make use of one of those - are mainly meant for editing. So if you are doing an application that does any kind of data analysis, or rendering, or something else, and especially if you believe that you will make many such queries, then this API call is not for you. You'll have to download an OSM excerpt or a "planet file" and analyse that.

OSM data does generally have a topology, so your approach of looking for nodes shared by more than one way should work. Of course, one street might consist of several way objcts. Ways will of course not share a node when there's a bridge or tunnel, or when one is e.g. a boundary line and the other a railway.

If two streets intersect and neither of them is a bridge or tunnel, then they should have an intersection node; editors and validators will complain if they haven't.

permanent link

answered 05 Dec '11, 21:13

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Thanks for your fast answer - good to know that my approach must work, so I just have to check that again.

But what is an OSM excerpt? I am doing such an API call only once, and then work with this data, so I thought that was the correct way..

(06 Dec '11, 07:58) raveNOSM

@raveNOSM: "Excerpt" refers to an OSM data extract that you can download directly (rather than fetch via the API). Downloading an extract causes much less load on the servers than using the API; the API is not suitable for mass data retrieval. See http://wiki.openstreetmap.org/wiki/Downloading_data for details.

(06 Dec '11, 11:04) sleske

If you're downloading this only once then don't worry. We're all easily frightened because every now and then someone writes an app that is then used by 1000s of people who download data wherever they go or so ;)

(06 Dec '11, 16:22) Frederik Ramm ♦

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:

×49

question asked: 05 Dec '11, 21:01

question was seen: 9,229 times

last updated: 06 Dec '11, 16:22

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