NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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.6k556210


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
6.2k25789
accept rate: 40%

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:

×689
×133

question asked: 24 Feb '12, 08:38

question was seen: 6,899 times

last updated: 26 Feb '12, 21:06

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum