Skip to content

Instantly share code, notes, and snippets.

@patchdynamics
Last active August 29, 2015 14:26
Show Gist options
  • Save patchdynamics/3d38d1099acf8016c608 to your computer and use it in GitHub Desktop.
Save patchdynamics/3d38d1099acf8016c608 to your computer and use it in GitHub Desktop.
Batch convert shape to raster user GDAL
find *.shp -exec gdal_rasterize -burn 1 -tr 200 200 {} ../nasqan_raster_lambert/{}.tif \;
# improve performance by loading more data into memory at once
find *.shp -exec gdal_rasterize --config GDAL_CACHEMAX 2400 -burn 1 -tr 30 30 -a_srs EPSG:5070 -of HFA {} ../nasqan_raster_conus/{}30.img \;
# compress tiffs using LZW to vasty improve disk performance
find *.shp -exec gdal_rasterize --config GDAL_CACHEMAX 4000 -burn 1 -tr 30 30 -a_srs EPSG:5070 -co COMPRESS=LZW {} ../nasqan_raster_conus/{}30.tiff \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment