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

Hello:

I want to find the closest way to a point defined by its geographic coordinates. I found out Overpass API which gave me a list of ways near a point. But I would like having one and only way.

Thank you.

asked 23 Feb '15, 16:19

osmccecsg's gravatar image

osmccecsg
46224
accept rate: 0%

edited 23 Feb '15, 23:14

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

that is the same question (if I assume you mean walkable/driveable "ways") as given-a-lat-lon-is-it-possible-to-find-the-closest-highwaystreet-record (or the linked questions there), isn't it? Update: ah, okay, specifically with Overpass here …

(23 Feb '15, 20:13) aseerel4c26 ♦

Sorting based on distance using Overpass API is already discussed in a Github issue, see [1] and [2]. Unfortunately, this feature is not yet available at this time.

I would suggest that you add this use case to the mentioned ticket (i.e. sorting by distance combined with top 1 result), so it doesn't get lost and could be considered for future development.

For the time being, you'd need to use your own logic and post process the Overpass API result to return the closest way only.

permanent link

answered 23 Feb '15, 22:25

mmd's gravatar image

mmd
5.7k15388
accept rate: 37%

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
×91
×25
×3

question asked: 23 Feb '15, 16:19

question was seen: 7,054 times

last updated: 23 Feb '15, 23:15

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