1

I would like to calculate the distance of some points to the nearest motorway, for that i would obviously need a series of vectors/lines etc. to represent the motorway.
On Overpass Turbo, the query

way["highway"~"motorway"]
(33.60615,-84.51173,33.92940,-84.22099);
out;

returns various objects like this:

{
  "type": "way",
  "id": 41047668,
  "nodes": [
    68146293,
    68146294
  ],
  "tags": {
    "bridge": "yes",
    "destination": "Peachtree Industrial Boulevard",
    "destination:ref": "GA 141 North",
    "highway": "motorway_link",
    "lanes": "1",
    "layer": "1",
    "oneway": "yes",
    "surface": "concrete"
  }
}

How can I use this information to come to my final destination?
Does each node have its own coordinates and is there a straight vector between these nodes which is the motoway? Or should I somehow modify my query?
Does anyone have experience with such a problem and can share some knowledge?

4
  • When trying your query it gets auto repaired to way["highway"~"motorway"] (33.60615,-84.51173,33.92940,-84.22099); /*added by auto repair*/ (._;>;); /*end of auto repair*/ out;. Also Im not sure if I understand your question. Why don't you just use the GeoJSON it returns? Also please clarify what you are trying to do using Python as you did not mention it in your question body.
    – MrXsquared
    Commented May 30, 2019 at 14:35
  • Well, I would like to calculate between some points and vectors (the motorways), for that i need the coordinates of the vector representing the motorway. All That this query returns is a series of cryptic nodes and tags, no coordinates...
    – Denny
    Commented May 30, 2019 at 14:38
  • Working fine for me on overpass-turbo.eu/s/JwZ
    – MrXsquared
    Commented May 30, 2019 at 15:56
  • I only seem to receive coordinates for nodes of junctions, not actual motorways (when you scroll further down), which still only have nodes depicted like this "<nd ref="67549955"/>"
    – Denny
    Commented May 30, 2019 at 16:09

1 Answer 1

2

Ways are composed of nodes as you surmise. You can get geometry by modifying the out call (see the documentation):

  • bb gives bounding box
  • center gives a centroid
  • geom gives ful geometry (probably the option you want and possibly with the JSON option).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.