Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Raster image to clip
- InputImage = 'Geotif.tif'
- # Polygon shapefile used to clip
- Shapefile = 'worldcoastlines.shp'
- rasterFormat = 'GTiff'
- vectorFormat = 'ESRI Shapefile'
- # Open datasets
- raster = gdal.Open(InputImage, gdal.GA_ReadOnly)
- wktproj = raster.GetProjectionRef()
- sref = osr.SpatialReference()
- sref.ImportFromWkt(wktproj)
- ulx, xres, xskew, uly, yskew, yres = raster.GetGeoTransform()
- lrx = ulx + (raster.RasterXSize * xres)
- lry = uly + (raster.RasterYSize * yres)
Add Comment
Please, Sign In to add comment