GeoDB Cities

By Michael Mogley | Updated a year ago | Data

9.9 / 10



Service Level


Back to All Discussions

Unable to find certain cities

5 months ago

We are not getting expected results for latin american locations. Has the data set changed?e.g., Searching for “Guatemala” using Cities api is not returning Guatemala City

wirefreethought commented 5 months ago

Fixed. Try this:

GET v1/geo/cities?limit=1&countryIds=GT&namePrefix=guatemala&sort=-population

I made some adjustments to the data-import logic, specifically:

  • Changed to soft-delete places queued for deletion before issuing subsequent adds/updates
  • Changed the soft-deletion semantics to prefer the Wikidata ID (over Geonames ID) since the former is guaranteed unique per place

Hopefully, this also addresses any other soft-delete issues you were experiencing.

wirefreethought commented 5 months ago

It turns out the issue here is an incorrect Wikidata Geonames id for Guatemala City. The given id, 3595529, is shared with Chinautla (where it’s actually correct). Unfortunately, the Guatemala City entry (Q1555) is locked so I can’t edit it. I’ll need to manually map to the correct Geonames id to avoid this clash. What other cities did you notice were wrongly soft-deleted? In the longer term, I will consider phasing out the Geonames association to avoid such issues, as I have little control over incorrect mappings between the two databases.

wirefreethought commented 5 months ago

I see. I will take a look to see what’s going on. Stay tuned.

boreasns commented 5 months ago

We are already using “sort=-population” option but this case is not about sorting.

In here, you mentioned about refreshing databases for duplicate entries.

There were two options for “Guatemala City” and I think you marked both as deleted. When we send a request for the “Guatemala” prefix, neither of these two options is available. That’s why we can’t find the exact locations. But when using “includeDeleted=ALL” option, we are receiving deleted ones.

Littlelunches commented 5 months ago

Thank you. For this specific case we noted that Guatemala City had been marked as deleted, when using ALL we received the city in the data set returned from the api.

wirefreethought commented 5 months ago

What’s the specific request you’re making? You should be sure to use either sort=-population to get the largest population matches first (or else set the minPopulation param to trim out small towns).

Join in the discussion - add comment below:

Login / Signup to post new comments
Rating: 4.8 - Votes: 6