Skip to content

[BUG] Proximity parameter is ignored #84

@dnywh

Description

@dnywh

Describe the bug
Passing a proximity query parameter has no effect on the forward geocoding search results.

To Reproduce
This can be reproduced on MapTiler's own geocoding demo page which (I think) uses the React component.

Here's how to test this manually:

  1. Create a search query vague enough to have results all over the world. Do this without specifying proximity. I assume this falls back on some kind of ranking and/or server-geolocation. Make note of the search results (features) and their ranking. For example:
    https://api.maptiler.com/geocoding/Mary.json?key=${apiKey}

  2. Run the search query again, this time specifying coordinates on the other side of the world. Note that the search results are identical as above. For example:
    https://api.maptiler.com/geocoding/Mary.json?proximity=7.098955%2C50.736281&key=${apiKey}

  3. Run the search query again, this time using fixed coordinates close to home. Note the search results are the same. For example:
    https://api.maptiler.com/geocoding/Mary.json?proximity=153.080353%2C-27.457043&key=${apiKey}

Expected behavior
The search results should respect the proximity rules: the results should be biased towards the provided [lon, lat].

Put simply: The results should differ depending on which coordinates I pass in the proximity parameter.

Screenshots

Test 1 Test 2 Test 3
test-1 test-2 test-3

Additional context
I've used "Mary" as my test search term as there are places across the UK, the US, and Australia (and elsewhere) that start with that term. I'm in Australia (quite close to a town called Maryborough) so would expect the Australian one(s) to show first. Note in the screenshots that the ranked results are instead always:

  1. Maryland, United States
  2. Mary, Turkmenistan
  3. Portlaoise, The Municipal District of Portlaoise, Ireland
  4. Maryborough, Queensland, Australia
  5. Maryino District, Moscow, Russia

Another good test is "Melbourne". There is a city in both the USA and in Australia with that name. Specifying proximity coordinates that are in either country has no effect on the results.

See also #11 from 2023, reporting something similar.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions