question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nominatim Geocoder appears to ignore the countrycodes

See original GitHub issue

Hello! It appears the Nominatum geocoder appears to be ignoring requested countries:

L.control.locate().addTo(map);
    var geocoder = new L.Control.geocoder({
        geocoder: L.Control.Geocoder.Nominatim({
            geocodingQueryParams: { countrycodes: 'gb'}
        })
    }).addTo(map);

But results appear to be global in nature:

screen shot 2016-02-03 at 17 37 29

Are there any known work arounds? Happy to dig around the code etc.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
sleadcommented, Dec 14, 2016
2reactions
perliedmancommented, Dec 14, 2016

Hi @slead, good to hear you’re finding the plugin useful! Which version of Leaflet Control Geocoder are you running? What does your code look like?

I’ve tested this with the following code:

var geocoder = L.Control.Geocoder.nominatim({
	geocodingQueryParams: {
		countrycodes: 'au'
	}
}),
control = L.Control.geocoder({
	geocoder: geocoder
}).addTo(map),

With this setup, running latest version of the plugin, searching for “Perth” I get this URL in Chrome devtools’ network tab:

https://nominatim.openstreetmap.org/search?q=perth&limit=5&format=json&addressdetails=1&countrycodes=au&json_callback=_l_geocoder_0

So it appears to work. Anything different in your setup that could explain this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Search - Nominatim 4.2.0
Each place in Nominatim is assigned to one country code based on OSM country ... If you do not want certain OSM objects...
Read more >
unable to Geocode with Openstreet Map provider since 3.2
I made some tests and the country can appear only one time , the country code can't appear. With google maps it works...
Read more >
GeoPy Documentation - Read the Docs
from geopy.geocoders import Nominatim ... Even if the proxy scheme is https, it will be ignored, and the connec-.
Read more >
Nominatim - OpenStreetMap
Either uses standard RFC 2616 accept-language string or a simple comma separated list of language codes. q=<query>, Query string to search for. countrycodes=< ......
Read more >
Set Up OSM Nominatim Geocoding Server on Ubuntu 20.04
Step 1: Install and Configure PostgreSQL. Note: If OSM tile server and Nominatim are installed on the same server, then you can skip...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found