For geocoding, to search for the Mainstreet 12, Amsterdam, Netherlands, (doesn't exist) we can call either

http://nominatim.openstreetmap.org/search?q=12,Mainstreet,Amsterdam,NL&format=xml

or

http://nominatim.openstreetmap.org/search?q=12,Mainstreet,Amsterdam&countryCodes=NL&format=xml

Which format is preferred? With country code appended in the q=, or with using countryCodes=

asked 24 Feb '12, 08:38

msol's gravatar image

msol
1334
accept rate: 0%

edited 24 Feb '12, 08:55

stephan75's gravatar image

stephan75
12.5k453209


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.

permanent link

answered 26 Feb '12, 21:06

lonvia's gravatar image

lonvia
5.3k25177
accept rate: 39%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×560
×113

question asked: 24 Feb '12, 08:38

question was seen: 4,394 times

last updated: 26 Feb '12, 21:06

powered by OSQA