11

I'm wondering if there is a service that to get a set of lat,long points that when connected into a polygon show the outline of a country

Ideally I would like to search by country, and get back an array of lat,long coordinates. Is there such a service?

2
  • 3
    Are you sure you want the bounding box, or just the boundary?
    – fmark
    Mar 3, 2011 at 23:29
  • just the boundary really - I want to be able to draw it on top of a google map Mar 7, 2011 at 15:32

4 Answers 4

7

IF you are happy to consider not using a webservice, this data is available at varying resolutions from Natural Earth. The data is in the public domain.

6

have a closer look here;

http://en.wikipedia.org/wiki/User:The_Anome/country_bounding_boxes

User:The Anome/country bounding boxes A first hack, based on all places in the NGA GNS dataset, not (yet) properly handling latitude wrap-round at ±180°. Country names are mapped from FIPS country codes. This works pretty well for all countries that do not cross the 180° meridian. Russia is a notable exception. This dataset does not include the United States.

country        longmin   latmin  longmax   latmax

 AA             -70.983   12.400  -69.850   12.617 
 Antigua_and_   -62.417   16.817  -61.650   17.750 
 United_Arab_    45.000   22.167   59.250   26.133 
 Afghanistan     60.433   29.150   75.033   38.484 
 Algeria         -8.700   18.027   70.554   37.203 
 Azerbaijan      44.783   38.417   50.858   41.911 
 Albania         19.000   39.583   21.050   42.659 
 Armenia         43.443   38.857   46.589   41.300 
 Andorra          1.417   42.433    1.783   42.650 
 Angola          10.000  -33.806   24.350   -3.033 
 Argentina      -73.533  -58.583  -53.367  -21.783 
 Australia      112.467  -55.050  168.000   -9.133 
 AT             122.983  -12.667  124.050  -12.000 
 Austria          1.200   46.373   19.000   49.017 
 AV             -63.667   18.150  -62.917   18.600 
 Bahrain         45.000   25.000   50.954   26.566 
 Barbados       -59.667   12.967  -59.383   13.333 
 Botswana        20.000  -28.517   29.350   24.583 
 BD             -64.908   32.233  -64.617   32.417 
 Belgium          2.367   49.500    6.400   51.683 
 Bahamas        -86.000   20.000  -70.000   29.547 
 Bangladesh      84.000   20.600   92.683   26.817 
 Belize         -89.950   15.000  -75.000   18.483 
 Bosnia_and_H    15.746   42.558   19.671   45.268 
 Bolivia        -69.650  -26.867  -57.550    9.678 
 Burma           91.833    6.000  102.000   28.350 
 Benin           -4.000    5.000   92.219   21.322 
 Belarus         22.550   50.717   32.850   56.133 
 Solomon_Isla  -130.000  -45.000  170.200    3.751    WRAPPED
 Brazil         -73.817  -33.733  -28.850   16.800 
 BS              39.700  -21.417   39.700  -21.417 
 Bhutan          80.000   26.217   92.717   30.000 
 Bulgaria        22.371   41.000   28.600   44.215 
 BV               3.278  -54.467    3.483  -54.386 
 Brunei         110.000   -2.000  120.000   15.000 
3

Yahoo! GeoPlanet, the service Stack Overflow are using for their careers site seems to do bounding boxes.

Here is a blog post with detailed query examples.

1

This repo contains a set of square bounding boxes. Example below:

{
  "AF": ["Afghanistan", [60.5284298033, 29.318572496, 75.1580277851, 38.4862816432]],
  "AO": ["Angola", [11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998]],
  "AL": ["Albania", [19.3044861183, 39.624997667, 21.0200403175, 42.6882473822]],
  "AE": ["United Arab Emirates", [51.5795186705, 22.4969475367, 56.3968473651, 26.055464179]],
  "AR": ["Argentina", [-73.4154357571, -55.25, -53.628348965, -21.8323104794]],
  "AM": ["Armenia", [43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671]],
  "AQ": ["Antarctica", [-180.0, -90.0, 180.0, -63.2706604895]],
  "…"
}

Full set of boxes:

https://github.com/sandstrom/country-bounding-boxes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.