api icon indicating copy to clipboard operation
api copied to clipboard

Coordinates of cities returned are imprecise (not the city center)

Open File5 opened this issue 1 year ago • 1 comments

Hello! We are considering to use Pelias API as general-purpose geocoding solution to search for countries, cities and places. We've deployed a self-hosted Pelias planet setup to tinker with it.

Describe the bug

The entries for some large cities returned by Pelias have imprecise locations (geometry point coordinates). We expect the resulting coordinates to be around city center, but they are seems to be closer to just a bounding box center.

Steps to Reproduce

  1. Run the search query https://pelias.github.io/compare/#/v1/search?lang=en&text=Munich
  2. Find the result for Munich, Germany and note the location on the map, i. e. geometry point coordinates in JSON.
  3. Compare with the entry for Munich in Who's On First https://spelunker.whosonfirst.org/id/1377787805

Expected behavior

The location on the map and geometry point coordinates in JSON should be near Marienplatz, Munich, Germany, which is the city center. This is the behavior of many other geocoding search engines (e. g. Google, Mapbox).

Environment (please complete the following information): https://api.geocode.earth and https://api.dev.geocode.earth hosts (the default values) are set in Pelias Compare Tool.

Our self-hosted setup: OS: Linux, Ubuntu 22.04.1 LTS Docker version 27.1.1, build 6312585 Docker Compose version v2.29.1 works similarly and has the same problem as well.

File5 avatar Sep 05 '24 09:09 File5

There are actually a bunch of different Munich records in WhosOnFirst (on different layers (ie. placetype in WOF parlance):

  • neighbourhood: https://spelunker.whosonfirst.org/id/1377787805
  • locality: https://spelunker.whosonfirst.org/id/101748479
  • localadmin: https://spelunker.whosonfirst.org/id/1377690691
  • county: https://spelunker.whosonfirst.org/id/102063261

These refer to different subdivisions of :

  • Munich 'Mitte' (ie. the central 'kiez')
  • Munich City: https://en.wikipedia.org/wiki/Munich
  • Munich District: https://en.wikipedia.org/wiki/Munich_(district)

I'm not 100% familiar with the localadmin/county distinction.

Anyway... what seems to be happening is that the larger administrative divisions are using math centroids, I will ask the WOF team if we can copy the city center centroid across to the larger administrative regions.

This is the one you were referring to above: https://pelias.github.io/compare/#/v1/search?layers=neighbourhood&size=1&text=munich

missinglink avatar Sep 06 '24 12:09 missinglink