Country code for international waters

I am implementing an API and C ++ SDK that will return two letter country codes such as "USA" for a given latitude / longitude. These ISO 3166-1 alpha-2 are well documented, but there is no code for international waters. Is there an agreement on what should be returned in this case?

+3


source to share


2 answers


The custom code element section in the Wikipedia article ISO 3166-1 alpha-2 might be helpful. In particular:

UN / LOCODE designates XZ to represent installations in international waters.



It's not part of ISO 3166, but at least there is an example of how another implementation has dealt with it.

+5


source


Your API might return a 404 not found or an empty string for such a location, so it would be clear that the country code cannot be found for the given location. There appears to be no real agreement on the assignment of any codes to international waters.

In the case of the C ++ API, consider adding some kind of status to the return value to indicate if the search was successful.



Bug should always be an option in any API design!

+2


source







All Articles