<div dir="ltr">Thank you for the clarification. <br></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Sep 1, 2018 at 1:55 PM Sarah Hoffmann <<a href="mailto:lonvia@denofr.de">lonvia@denofr.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
On Fri, Aug 31, 2018 at 06:28:31PM +0530, Leo Orson wrote:<br>
> Hello everyone,<br>
> <br>
> I tried to geocode "Hong Kong"<br>
> (<a href="https://nominatim.openstreetmap.org/search.php?q=Hong" rel="noreferrer" target="_blank">https://nominatim.openstreetmap.org/search.php?q=Hong</a><br>
> Kong&format=json&addressdetails=1&accept-language=en), and the country code<br>
> comes out to be "cn".<br>
<br>
Nominatim takes the country code from the country the place is in<br>
which in this particular case is China.<br>
<br>
> But according to this list (<br>
> <a href="https://wiki.openstreetmap.org/wiki/Nominatim/Country_Codes" rel="noreferrer" target="_blank">https://wiki.openstreetmap.org/wiki/Nominatim/Country_Codes</a>), I found the<br>
> country code for Hong Kong to be "HK", and hence I believe we should be<br>
> getting HK instead of CN.<br>
<br>
This list just contains the codes Nominatim knows about, not where they<br>
are applied.<br>
<br>
> I did some research and I believe the Relation: China (270056) (<br>
> <a href="https://www.openstreetmap.org/relation/270056/history#map=6/20.056/114.675" rel="noreferrer" target="_blank">https://www.openstreetmap.org/relation/270056/history#map=6/20.056/114.675</a>)<br>
> is the reason. Not sure how to fix this, hence thought of mailing it here.<br>
<br>
This is not a data error but a fundamental design issue with Nominatim<br>
which cannot handle overlapping countries well (also an issue with<br>
disputed areas). I've added the case to<br>
<a href="https://github.com/openstreetmap/Nominatim/issues/202" rel="noreferrer" target="_blank">https://github.com/openstreetmap/Nominatim/issues/202</a><br>
but I'm sorry to say it is unlikely that this will get fixed any time soon.<br>
<br>
Kind regards<br>
<br>
Sarah<br>
</blockquote></div>