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

I have two requests to get supermarkets within a country but both are slow and I'm asking myself if there is a way to improve them.

The first query is used to get supermarkets in France only, within a radius of 2 kilometers around the coordinates provided :




(In this example, the coordinates correspond to the location of Paris).

For the second request, I want to obtain supermarkets in France only as well but sorted by brand and city. Currently, I use the query below to get all the supermarkets in a given city (but it's not limited to France). After my request, I sort the results by brand in my code.




Is it possible to improve both queries and make them faster? I'd also like to limit the second query to France, and why not, if it's more efficient sort the results by brand with the API and not with my code.

asked 13 Aug '19, 15:21

Arouraz's gravatar image

accept rate: 0%

edited 14 Aug '19, 18:06


please note that supermarkets (and POIs in general) can also be mapped as ways or as relations. You have to use 'nwr' instead of 'node'

(14 Aug '19, 04:10) escada

I didn't know that, I updated the code, thank you!

(14 Aug '19, 18:08) Arouraz

The Default timeout value is 180. Setting it to 40 isn't required.

Depending on what you want to do with the output data, converting it to json is often unnecessary.

Quotation marks are only needed when a colon is in the expression.

Specifying France isn't required as the around statement limits the search area.

As there's only one line of code the containing brackets aren't required

out center;

There's quire a few areas with Paris as it's name. Best to specify a single one. I used this one, If you wish to use another relation, add its id to 3600000000 to get the area id. If you're only using using a single area once, then there's no need to store it in a variable (RESULTS).

out center;

out geom;

I think relation 2202162 is the incorrect one to use for mainland France:

permanent link

answered 19 Aug '19, 18:04

DaveF's gravatar image

accept rate: 16%

edited 19 Aug '19, 18:13

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 13 Aug '19, 15:21

question was seen: 3,447 times

last updated: 19 Aug '19, 18:13

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