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:
- 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.
- 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.
- 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.
- 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.
- 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)

