Skip to content

Instantly share code, notes, and snippets.

@gijs
Forked from geobabbler/worlddfile.py
Created April 28, 2014 09:52
Show Gist options
  • Save gijs/11367233 to your computer and use it in GitHub Desktop.
Save gijs/11367233 to your computer and use it in GitHub Desktop.
def WorldFileParameters(self, tx, ty, zoom):
"Returns world file (affine transofrmation) parameters of the given tile"
bounds = self.TileBounds( tx, ty, zoom)
moriginx = bounds[1] + (self.Resolution(zoom) / 2)
moriginy = bounds[2] - (self.Resolution(zoom) / 2)
return (self.Resolution(zoom), 0.0, 0.0, self.Resolution(zoom) * -1, moriginx, moriginy)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment