Hi,

I want to extract a route with the Overpass API which works great. But I have some problemns getting the order of the nodes inside the relation right.

Check this relation: http://overpass-turbo.eu/s/hao

It looks good on the map. But when you look at the data tab and you scroll a little down you see the coordinates jump from

  • 13.8223610, 100.5474506
  • To
  • 15.1323097, 100.4504222

which is in the middle of the route. At the bottom there are the parts which are in between. (14.xxx)

So when I extract the route, process all the coordinates in the order the api returns them and convert it to a Google Polyline path, the route is messed up.

Paste this path into Google maps example (https://developers.google.com/maps/documentation/utilities/polylineutility and click decode polyline)

kfrsAefydRprJztDc|bGdiP}qQvlPiqV~fHofUzrYk|@r[snUaWeoTneDsnAadA_xAepGgC{hBwoB{{DgkN{rEelCuEicZmlKs`EitC}_NcyE_b`@awB}|I~|BatOvyB{wFrdDu|@xuBclKjtAanBdcAsjNp{E{~GIweKt|Bsd\}Q{wf@daO}dQz`MwsFtqEclJ{sAiuRdjBicGccCm}FyP}~Do`AmlFpD_dCpt@q}L~f@sgFedAgSqhBskMia@e}Rr}MjjIygJxyDo}B~vBtG{bSvhN{xB|Scmc@l{V}HkmB`sByoAd_BuvD~{Bg`Lb|Ciy@rs@r_@|kFat@|}BzhC|tFeTog}@j{`@|hFj}Bjy@}E`dGwoEyu@gcF|{GvZqqXxxHcu|@hmtBffJsM`_Dx`@feE}vAts@gaAs|Ag_CfpA}aD|rCwpCzwKigV`fOsiK_{B_~FybDmlBmuB_gF~f@wfFeFs|DqbAg}@iTgwKmt@c|D_qAg{@anAk_D`ZosB`}BiKr|AmdBbzGnE``B|f@_yx@vmuBbaA~@eiCraHe]gbGfeBk`@qiAphHmiD|v_@jcFky@rrJtd@cuAebFjVedEopDqpJe_BowAokGjg[eqFr_DlaCs_CvnB__@ycHjoDinXkmBrxAae@hyIdD~sHbrCgb`@nShyHweCxn_YojhIoh@oVkiS`^m`LePe{KdkDy_Qx`Oqji@rdHwb@lRijV~uUlyhCq`l@pmEhbLr|BjeDzyC~RvvMuWboFr[dj}AxxKicMcxD{ySmnJgq@sIyfPxbAalKpbAcsOl|@wmJgj@zq_BrcL

How do I get overpass to give the nodes inside the relation in the correct order??

asked 06 Jul '16, 16:00

NLAnaconda's gravatar image

NLAnaconda
1665613
accept rate: 0%


Your conversion routine does not seem to work correctly. Ways in relations don't need to follow the exact sequence of a route. As Overpass API delivers the data in the exact same sequence as they are in the main OSM database, it's your responsibility to bring them in the right sequence in a post-processing step.

As additional hint, please see this answer by scai: link

Furthermore, you might want to check the result of (relation(1820650);>;);out meta; to get all node ids as well. out geom; only provides lat/lon values of nodes, but omits all node ids.

permanent link

answered 06 Jul '16, 17:01

mmd's gravatar image

mmd
5.6k4988
accept rate: 37%

edited 06 Jul '16, 17:08

1
(07 Jul '16, 02:09) NLAnaconda
Your answer
toggle preview

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:

×355
×240
×190
×13

question asked: 06 Jul '16, 16:00

question was seen: 1,857 times

last updated: 07 Jul '16, 02:09

powered by OSQA