Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Working out the bounding box of a coutnry

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?

like image 917
Laurie Young Avatar asked Mar 03 '11 22:03

Laurie Young


People also ask

How do you find the bounding box of a city?

You can find the bounding box of those cities at www.mapdevelopers.com/geocode_bounding_box.php. Entering a city will display a box on a map and give the latitude and longitude of each side. Hopefully that will give you the information you need.

What is bounding box location?

A bounding box (usually shortened to bbox) is an area defined by two longitudes and two latitudes, where: Latitude is a decimal number between -90.0 and 90.0. Longitude is a decimal number between -180.0 and 180.0.

What is bounding box size?

In geometry, the minimum or smallest bounding or enclosing box for a point set S in N dimensions is the box with the smallest measure (area, volume, or hypervolume in higher dimensions) within which all the points lie.


2 Answers

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

like image 160
sandstrom Avatar answered Oct 30 '22 09:10

sandstrom


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.

like image 31
fmark Avatar answered Oct 30 '22 09:10

fmark