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

I want to get the polyline's coordinates without any extra info from a relation like this one:

[[40.54,40.65],[40.55,40.64]...]

Here are some relations for which I need this data: 29322, 19782, 19763

How can I do it? I tried to use overpass turbo but it gives me ways and nodes which is not what I want.

asked 13 May '20, 09:21

Dimitar155's gravatar image

Dimitar155
11114
accept rate: 0%

edited 13 May '20, 09:22


Overpass Turbo also lets you export GeoJSON which comes very close to what you are looking for.

permanent link

answered 13 May '20, 09:30

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Overpas turbo gives me multiple arrays and the polyline is broken for some reason. https://i.imgur.com/2VNyWBe.png The red line should be following the black markers. Also here the line is fine but only for the one direction. On the other it gets wiggly. https://i.imgur.com/d1fznCF.png

(13 May '20, 09:37) Dimitar155
1

I tried an Overpass query like relation(19763); out geom; and loaded that in geojson.io and it looks all right...

(13 May '20, 09:48) Frederik Ramm ♦

It looks like something went wrong when I saved the data to the database which caused the problem.

edit: It doesn't work for relation 19777. Overpass Turbo returns multilinestring instead of linestring which breaks something. How can I convert multilinestring to linestring?

edit 2: This query fixed everything:

[out:json][timeout:300];

(

relation(relation_id);

<;

);

out geom;

(13 May '20, 10:40) Dimitar155

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:

×228
×8

question asked: 13 May '20, 09:21

question was seen: 2,654 times

last updated: 13 May '20, 10:59

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