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

I want to get all the ways along a track (set of points) for classification. Currently, I create a query by concatenating each point like so:

[out:json][timeout:25];
way["highway"](around:1,48.077600000109015,11.573480996224898);(._;>;);out;
way["highway"](around:1,48.076880000051446,11.573426998490564);(._;>;);out;
way["highway"](around:1,48.0761600000356,11.573377499687094);(._;>;);out;
way["highway"](around:1,48.0754400000356,11.573332499687094);(._;>;);out;
way["highway"](around:1,48.0746410000306,11.573278997883973);(._;>;);out;

etc.. However (as I expected) this takes too long for a couple of thousand points. I don't want to increase the timeout.

Is there a more efficient way for this kind of query?

asked 05 Feb '16, 19:08

lcanis's gravatar image

lcanis
11112
accept rate: 0%


If I am not wrong, the around parameter works with a real circle ... that clipping is very time consuming for the server, I assume.

So a better way can be that you calculate rectengular bounding boxes around each point, and the you do overpass-api queries by those boxes as parameter, that should be quite faster.

Or download a country extract from raw OSM data from any sourve mentioned at planet.osm, and do some filtering and clipping with your batch calculated mini bounding boxes with tools like osmfilter, osmconvert .

permanent link

answered 06 Feb '16, 11:02

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

Thank you for your answer. I tried a bounding box around each point first, but the speed increase is not very big. Currently I'm combining the points and their bounding boxes until I reach a given area for the bounding box, thereby reducing the number of combined requests drastically. This is much faster, but still pretty slow: Around 20s for an 80km track. I have since learned about alpha shapes, this could be a way to go but it would make the request more complicated.

I am reluctant to go the raw OSM data route since in the end I would need to practically have the whole planet.osm available locally or on a private server and I was hoping to be lightweight and fast.

(07 Feb '16, 13:04) lcanis

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:

×483
×65

question asked: 05 Feb '16, 19:08

question was seen: 3,135 times

last updated: 07 Feb '16, 13:04

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