Create a gist now

Instantly share code, notes, and snippets.

@smathermather /zmi_level1.md Secret
Last active Jun 13, 2017

What would you like to do?
REM Steps for processing for Level 1 ZMI Data
REM Create monstrous TIF of everything:
REM First prep the file
gdal_merge -o D:\FROM_ZMI\zmi_unguja_mosaic.tif -co TILED=YES --optfile list.txt -createonly -ps 0.07 0.07
REM Then merge in the tifs
FORFILES /m *.tif /C "CMD /C gdalwarp @file D:\FROM_ZMI\zmi_unguja_mosaic.tif"

REM Cut out square tiles from Zone grid
FORFILES /m "*.shp" /s /C "CMD /C gdalwarp -cutline @FILE D:\FROM_ZMI\zmi_unguja_mosaic.tif d:\FROM_ZMI\\@FNAME.tif"
REM Add overviews
FORFILES /m *.tif /s /C "CMD /C gdaladdo -r average --config COMPRESS_OVERVIEW DEFLATE @file 2 4 8 16 32 64 128 26 512 1024 2048 4096"

REM Combine back together in a VRT for viewing:
dir /B *.tif > list.txt -- no quotes need removed
gdalbuildvrt -input_file_list list.txt zmi_unguja_mosaic.vrt -srcnodata "0 0 0" -resolution user -tr 0.07 0.07 -overwrite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment