pelias / pelias/api

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

Open
#1,677 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
259
Forks
169
Avg merge
6h 15m
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Munich search in the Pelias Compare Tool and inspect the returned geometry coordinates. Compare that result with the Who's On First Munich entry and the expected location near Marienplatz. Trace where the API obtains or transforms the city coordinates, then verify that the returned point represents the city center rather than a bounding-box center.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.