Created
April 16, 2013 16:41
-
-
Save timlinux/5397459 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iface = qgis.utils.iface | |
# make sure the raster layer is active before you type the next commands | |
l = iface.activeLayer() | |
r = l.extent() | |
s = r.toString() | |
t = s.split(' : ') | |
t1 = t[0].split(',') | |
t2 = t[1].split(',') | |
wkt = 'POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))' % (t1[0], t1[1], t1[0], t2[1], t2[0], t2[1], t2[0], t1[1], t1[0], t1[1]) | |
print wkt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment