This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Puerto Rico ISO 3166-2 code

0

hello.

i am trying to do a lookup for Carolina, PR using parameters for structured requests:

https://nominatim.openstreetmap.org/search?format=json&limit=1city=carolina&country=pr

However the lookup works only with US:

https://nominatim.openstreetmap.org/search?format=json&limit=1&city=carolina&country=us

According to wikipedia the ISO 3166-2 code for Puerto Rico is PR. I know it's an administrative part of the USA but shouldn't be the primary ISO 3166-2 code PR?

for certain countries it doesn't work at all:

https://nominatim.openstreetmap.org/search?format=json&limit=1&city=Punta+Caucedo&country=do

but works with freeform query:

https://nominatim.openstreetmap.org/search?format=json&limit=1&q=Punta+Caucedo%2C+do

asked 14 May '21, 11:42

minusf's gravatar image

minusf
11111
accept rate: 0%

edited 14 May '21, 12:32

Quick test shows similar for Papeete (French Polynesia is another dual coded place FP & FR_FP). Some others no longer exist (eg, Isle of Man IM & GB-IOM).

(14 May '21, 12:03) SK53 ♦

Source code available on GitHub .