Skip to content

Instantly share code, notes, and snippets.

@wildintellect
Last active August 29, 2015 14:01
Show Gist options
  • Save wildintellect/474400f316bb93ebecb1 to your computer and use it in GitHub Desktop.
Save wildintellect/474400f316bb93ebecb1 to your computer and use it in GitHub Desktop.
Convert BBOX+Image to World File
#how to make world file from a bounding box and an image file - aka kml/kmz
#Generic Formula
(W-E)/(width pixels)
0
0
(N-S)/(width pixels)
West+.5*abs((W-E)/(width pixels))
North-.5*abs((N-S)/(height pixels))
#Example
((abs(80.2495816317472))-(abs(-74.697157981179)))/600
0
0
-((abs(41.515232294256))-(abs(36.425510614568)))/550
-80.2495816317472 (+1/2 pixel)
41.515232294256 (-1/2 pixel)
#Results
0.009254039
0
0
-0.009254039
-80.240327593
41.505978255
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment