[OSM-talk] Nominatim on the main page

Tom Hughes tom at compton.nu
Sun Feb 18 17:45:27 UTC 2018


On 18/02/18 17:34, Paul Johnson wrote:

> On the OSM homepage, can we use the visible area (or maybe that plus an 
> exploded offset to a larger surrounding bounds) as a bonding box to be 
> passed to Nominatim for some context when searching?  This animation 
> really drives the problem home.

We already do exactly that.

Sarah can clarify the details but we pass the bounding box to Nominatim
and I believe it expands that by a factor of two and then prefers any
results in that area over those further afield.

Here's the relevant code:

https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/geocoder_controller.rb#L115

Which encodes the bounds as the viewbox parameter which is then passed
through when calling Nominatim.

Tom

-- 
Tom Hughes (tom at compton.nu)
http://compton.nu/



More information about the talk mailing list