Template talk:Geobox locator

From Wikipedia, the free encyclopedia

[edit] Finding map corners

The following procedure seems to work for finding the map corner coordinates:

  1. For each side (top, bottom, left, right), calculate how much border is present around the image. The states are outlined in a 2-pixel border line, so assume the middle of that line is the actual state line.
  2. Find the GPS coordinates of the exact westernmost, easternmost, northernmost and southernmost points in the state. Calculate how many degrees of latitude/longitude site is high/across.
  3. From the overall image width (and height), remove the border part so that you get the width and height (in pixels) of the state itself.
  4. Using the width and height of the state in pixels and your calculation in degrees, figure out how many degrees each pixel is wide or high.
  5. Figure out how many degrees each of the four borders is wide or high, and adjust your top/bottom/left/right coordinates accordingly by adding the border's value on to the actual corner of the state.

Brian Powell (talk) 23:59, 12 April 2008 (UTC)