2 added 54 characters in body
source | link

Where do I live? *

Given a coordinate pair, supporting at least 2 decimal places (precision .01), determine the country containing that coordinate pair. The coordinate will be on land and will be at least 0~0.5 degrees (~50 km Great Circle distance; thanks Peter Taylor!) from any border or coastline.

Input will be given as two decimal numbers in any reasonable format. Output should be the English name of the country according to this source; spaces, accents, non-alphanumeric characters, and capital letters are all optional. For countries like Iran, you can choose to output either "Iran" or "Islamic Republic of Iran". The same applies for all ...Republic... countries, like N/S Korea, Lao, Taiwan, etc. For Côte D'ivoire, you can choose to output either "Côte D'ivoire" or "Ivory Coast".

Exact built-ins are not allowed (ahem Mathematica). Online APIs are not allowed (ahem Google Maps).

Western and Southern coordinates can be given as a negative decimal or with W and S (you can also have N and E if wanted). Please specify your input format.

You will have to handle coordinates in Antarctica. Apparently it's a country now.

Test Cases

Input           -> Output

43.26N,  79.54W -> Canada
37.42N,  94.88W -> United States of America
25.96N, 103.51W -> Mexico
 9.39S,  59.39W -> Brazil
79.66S,  65.22E -> Antarctica
90.00S,  00.00E -> Antarctica # It's such a shame that 90N ?E/W is in the middle of the ocean
74.25N,  40.00W -> Greenland
63.08N,  15.34E -> Sweden
66.19N,  98.93E -> Russia
30.72N, 103.39E -> China
 2.89S, 119.55E -> Indonesia
26.96S, 132.91E -> Australia

* not a real tag but I propose to add it

Where do I live? *

Given a coordinate pair, supporting at least 2 decimal places (precision .01), determine the country containing that coordinate pair. The coordinate will be on land and will be at least 0.5 degrees from any border or coastline.

Input will be given as two decimal numbers in any reasonable format. Output should be the English name of the country according to this source; spaces, accents, non-alphanumeric characters, and capital letters are all optional. For countries like Iran, you can choose to output either "Iran" or "Islamic Republic of Iran". The same applies for all ...Republic... countries, like N/S Korea, Lao, Taiwan, etc. For Côte D'ivoire, you can choose to output either "Côte D'ivoire" or "Ivory Coast".

Exact built-ins are not allowed (ahem Mathematica). Online APIs are not allowed (ahem Google Maps).

Western and Southern coordinates can be given as a negative decimal or with W and S (you can also have N and E if wanted). Please specify your input format.

You will have to handle coordinates in Antarctica. Apparently it's a country now.

Test Cases

Input           -> Output

43.26N,  79.54W -> Canada
37.42N,  94.88W -> United States of America
25.96N, 103.51W -> Mexico
 9.39S,  59.39W -> Brazil
79.66S,  65.22E -> Antarctica
90.00S,  00.00E -> Antarctica # It's such a shame that 90N ?E/W is in the middle of the ocean
74.25N,  40.00W -> Greenland
63.08N,  15.34E -> Sweden
66.19N,  98.93E -> Russia
30.72N, 103.39E -> China
 2.89S, 119.55E -> Indonesia
26.96S, 132.91E -> Australia

* not a real tag but I propose to add it

Where do I live? *

Given a coordinate pair, supporting at least 2 decimal places (precision .01), determine the country containing that coordinate pair. The coordinate will be on land and will be at least ~0.5 degrees (~50 km Great Circle distance; thanks Peter Taylor!) from any border or coastline.

Input will be given as two decimal numbers in any reasonable format. Output should be the English name of the country according to this source; spaces, accents, non-alphanumeric characters, and capital letters are all optional. For countries like Iran, you can choose to output either "Iran" or "Islamic Republic of Iran". The same applies for all ...Republic... countries, like N/S Korea, Lao, Taiwan, etc. For Côte D'ivoire, you can choose to output either "Côte D'ivoire" or "Ivory Coast".

Exact built-ins are not allowed (ahem Mathematica). Online APIs are not allowed (ahem Google Maps).

Western and Southern coordinates can be given as a negative decimal or with W and S (you can also have N and E if wanted). Please specify your input format.

You will have to handle coordinates in Antarctica. Apparently it's a country now.

Test Cases

Input           -> Output

43.26N,  79.54W -> Canada
37.42N,  94.88W -> United States of America
25.96N, 103.51W -> Mexico
 9.39S,  59.39W -> Brazil
79.66S,  65.22E -> Antarctica
90.00S,  00.00E -> Antarctica # It's such a shame that 90N ?E/W is in the middle of the ocean
74.25N,  40.00W -> Greenland
63.08N,  15.34E -> Sweden
66.19N,  98.93E -> Russia
30.72N, 103.39E -> China
 2.89S, 119.55E -> Indonesia
26.96S, 132.91E -> Australia

* not a real tag but I propose to add it

1
source | link

Where do I live? *

Given a coordinate pair, supporting at least 2 decimal places (precision .01), determine the country containing that coordinate pair. The coordinate will be on land and will be at least 0.5 degrees from any border or coastline.

Input will be given as two decimal numbers in any reasonable format. Output should be the English name of the country according to this source; spaces, accents, non-alphanumeric characters, and capital letters are all optional. For countries like Iran, you can choose to output either "Iran" or "Islamic Republic of Iran". The same applies for all ...Republic... countries, like N/S Korea, Lao, Taiwan, etc. For Côte D'ivoire, you can choose to output either "Côte D'ivoire" or "Ivory Coast".

Exact built-ins are not allowed (ahem Mathematica). Online APIs are not allowed (ahem Google Maps).

Western and Southern coordinates can be given as a negative decimal or with W and S (you can also have N and E if wanted). Please specify your input format.

You will have to handle coordinates in Antarctica. Apparently it's a country now.

Test Cases

Input           -> Output

43.26N,  79.54W -> Canada
37.42N,  94.88W -> United States of America
25.96N, 103.51W -> Mexico
 9.39S,  59.39W -> Brazil
79.66S,  65.22E -> Antarctica
90.00S,  00.00E -> Antarctica # It's such a shame that 90N ?E/W is in the middle of the ocean
74.25N,  40.00W -> Greenland
63.08N,  15.34E -> Sweden
66.19N,  98.93E -> Russia
30.72N, 103.39E -> China
 2.89S, 119.55E -> Indonesia
26.96S, 132.91E -> Australia

* not a real tag but I propose to add it