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

I am completely new to OSM. Sorry if this is a dumb question.

My goal is to list the nearest gas stations in order, or all gas stations within a certain area. They don't need to be displayed on a map.

I have found out that I need to use amenity=fuel, but I'm not sure how to make the query, or where to run the query.

asked 05 Sep '13, 14:48

pag11123's gravatar image

pag11123
56227
accept rate: 0%


One of the possible solutions is to run an overpass query. The http://overpass-turbo.eu/s/Yu one should list all the gas stations within the bounding box that you specify. I'm aware that this is a graphical UI, but you can run the same query from any program language (as it is an http call). The data is can be returned as GeoJSON. All gas stations are specified with the coordinates, so you application can calculate the distance to each one and order them.

More information on overpass can be found here: http://overpass-api.de/

permanent link

answered 05 Sep '13, 17:42

escada's gravatar image

escada
19.0k16166302
accept rate: 21%

2

Also, if you want a non-interactive version, you might want to consider "normal" Overpass rather than the turbo version, which supports both its own and the old XAPI-style syntax.

(05 Sep '13, 17:52) SomeoneElse ♦

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:

×193
×147
×94
×3

question asked: 05 Sep '13, 14:48

question was seen: 8,681 times

last updated: 05 Sep '13, 17:52

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