I used to find objects inside the São Paulo State by simply using "São Paulo" in nominatim. Likewise, objcets inside the city of São Paulo could be found by using "SP".

Now it seems that something has changed and, no matter what kind of combination of "SP" and "São Paulo" I use, they all return the city as the first result (and this also affects overpass queries).

Some examples that I did try without success:

What do I need to do to differentiate if I want to search for the city or for the State, when both have the same name, please?

asked 27 Jul, 03:39

naoliv's gravatar image

naoliv
6006919
accept rate: 37%


Both have the same name and short_name. Which of state or the city are more relevant as first result is debatable, both are in the top 5 results. Since the city is inside the state there is no phrase you can add to the Nominatim query to make it prefer one or the other, Nominatim doesn't have tag filters like some other search engine do. Same issue with many state capitals around the world: Washington D.C. (both city and district), Berlin (city and state), Vienna. Does Overpass allow setting the osm_id instead?

permanent link

answered 27 Jul, 03:59

mtmail's gravatar image

mtmail
2.6k644
accept rate: 26%

Indeed, we can search/filter by the area (relation) id https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#By_area_.28area.29 For my case https://overpass-turbo.eu/s/LpZ Thanks!

(08 Aug, 20:01) naoliv
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:

×550

question asked: 27 Jul, 03:39

question was seen: 193 times

last updated: 08 Aug, 20:01

powered by OSQA