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

In my installation of Nominatim, reverse queries are showing the wrong city name for numerous locations in the San Francisco Bay Area. However the “official” Nominatim website seems to do it correctly:

Shows city as “San Jose” (correct):

Shows city as “Santa Clara” (incorrect):

Also here is an incorrect street’s details page:

I found this question which suggests that I can fix the city names by drawing the city as a relation. But as it is working on the official Nominatim, doesn’t that mean that the correct city boundaries are in the OSM dataset, and my installation is just displaying it incorrectly?

My nominatim url is here:

Any help is greatly appreciated!

asked 28 Oct '13, 07:58

mparncutt's gravatar image

accept rate: 0%

You don't need to create this relation, it already exists and also indexed by the official Nominatim instance. I guess your instance did not index this relation and thus provides a less accurate geolocation result. Maybe some problem during the import? Or did you import a dataset which didn't contain relations?

(28 Oct '13, 08:31) scai ♦

Did you end up finding a solution to this? I'm also having this problem with SF Bay Area.

(04 Nov '13, 20:00) baekacaek

The boundary relation for San Jose is broken. You can see a few errors reported by OSM Inspector. Nominatim has a mechanism to keep old versions of boundaries around when it finds a broken one. That is why you see the difference between the instance and your import.

If you have just imported your database, you can get a list of broken polygons under the URL your.instance/polygons.php (you don't seem to have exported that on your instance but it still should be there). This list is not updated when diffs are applied, so the list on is not really useful at the moment.

Once the data is fixed in OSM, things will sort themselves out in Nominatim when diffs are applied. If you don't use diffs, you can also manually reimport the relation with:

./utils/update.php --import-relation [relation id] --index --index-instances 2
permanent link

answered 28 Oct '13, 08:38

lonvia's gravatar image

accept rate: 40%

I'd firstly like to thank the people who have replied thus far!

As suggested, I’ve fixed the relation for San Jose and this is now live on OpenStreetMap and has found its way into my instance through the diffs:

But it does not appear to have solved the problem.

I also notice that I don’t get proper place names for Berkeley, even though the Berkeley relation is intact (and always has been).

Here are some comparisons between my instance and the official Nominatim instance:

Hearst Ave, Berkeley:

The city is correctly shown as “Berkeley” in the address, referencing the boundary:administrative for Berkeley

The city is incorrectly shown as “Alameda” in the address, referencing the place:city for Alameda. The boundary:administrative for Berkeley appears there, but is greyed out, and so doesn’t appear in the address returned by the API:

The two instances also disagree on the neighbourhood (I don’t know which is correct) but I don’t mind too much about this, as my application doesn’t use neighbourhood.

East Saint James St includes the boundary:administrative for San Jose as part of the address:

East Saint James St does not reference the boundary:administrative for San Jose, even though it is now available on the instance:

(21 Nov '13, 07:55) mparncutt

It's possible that Nominatim did not propagate the boundary changes for efficiency reasons. Try to force a reindex on the entire city by running the following command directly on your DB: select place_force_update(<place_id>) where <place_id> should be the internal Nominatim id. You can find it in the URL of the details page (possibly after clicking GOTO of the first address entry). It is 171218834 for San Jose in your DB.

(21 Nov '13, 09:22) lonvia

I don't have that function because I was using Nominatim 2.0.1. I've tried to upgrade to the latest Nominatim from git, but now I have this additional issue when I was trying to import the file as suggested in here:

But I get this error:

I also seem unable to run updates anymore. It imports 0 nodes/ways/relations each time :(

(22 Nov '13, 05:05) mparncutt

You can't update to 2.1 without a reimport, there have been some other changes to the database schema as well. If you cannot reimport, go back to 2.0.1 and just install the place_force_update function from sql/functions.sql from 2.1.

(23 Nov '13, 11:22) lonvia

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: 28 Oct '13, 07:58

question was seen: 5,349 times

last updated: 23 Nov '13, 11:22

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