Last active
August 29, 2015 14:27
-
-
Save patchdynamics/141751932b7c3e464b56 to your computer and use it in GitHub Desktop.
Crop high def raster to polygon efficiently
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
# tried with gdalwarp, but ends up slow with a huge file | |
gdalwarp -q -cutline /Users/matthewxi/Documents/Projects/NASQAN/clip_columbia_extent_conus.shp -crop_to_cutline -co COMPRESS=LZW -of GTiff /Users/matthewxi/Documents/Projects/NASQAN/nasqan_raster_conus_compressed/b14246900_polygon.shp30.tiff /Users/matthewxi/Documents/Projects/NASQAN/b14246900_nlcd_clipped_3.tif | |
# gdal_translate seems to be the better option | |
# using extents to crop | |
gdal_translate -projwin -2191346 3275471 -1068667 2168385 -co "COMPRESS=LZW" /Users/matthewxi/Documents/Projects/NASQAN/nasqan_raster_conus_compressed/b14246900_polygon.shp30.tiff /Users/matthewxi/Documents/Projects/NASQAN/b14246900_nlcd_clipped_7.tif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment