For geocoding, to search for the Mainstreet 12, Amsterdam, Netherlands, (doesn't exist) we can call either
or
Which format is preferred? With country code appended in the q=, or with using countryCodes= |
There is a slight difference in how Nominatim handles these two queries. In the first query, it will check for all occurrences of 'NL' in the database, so in very rare cases you may end up with unexpected results. Given the second form with the countryCodes parameter, it restricts the search to places within the country right from the start. So, both query forms are perfectly legitimate and give the same results in most cases. If you know you have search requests for a specific country, the second form might be more efficient. But if you are not sure, there is no need to parse and format the query. Just go with the first form then. answered 26 Feb '12, 21:06 lonvia |