0

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, 09:21

Dimitar155's gravatar image

Dimitar155
113
accept rate: 0%

edited 13 May, 09:22


One Answer:
0

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

permanent link

answered 13 May, 09:30

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
73.3k866641137
accept rate: 24%

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, 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, 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, 10:40) Dimitar155

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:

×139
×8

question asked: 13 May, 09:21

question was seen: 114 times

last updated: 13 May, 10:59

powered by OSQA