Guest User

Untitled

a guest
Mar 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. # Raster image to clip
  2. InputImage = 'Geotif.tif'
  3.  
  4. # Polygon shapefile used to clip
  5. Shapefile = 'worldcoastlines.shp'
  6.  
  7. rasterFormat = 'GTiff'
  8. vectorFormat = 'ESRI Shapefile'
  9.  
  10. # Open datasets
  11. raster = gdal.Open(InputImage, gdal.GA_ReadOnly)
  12. wktproj = raster.GetProjectionRef()
  13. sref = osr.SpatialReference()
  14. sref.ImportFromWkt(wktproj)
  15.  
  16. ulx, xres, xskew, uly, yskew, yres = raster.GetGeoTransform()
  17. lrx = ulx + (raster.RasterXSize * xres)
  18. lry = uly + (raster.RasterYSize * yres)
Add Comment
Please, Sign In to add comment