Advertisement
rotulet

pyramid from asc

Jan 28th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.86 KB | None | 0 0
  1. mkdir ${TARGET_DIR}_tif
  2. echo "building ${BIG_TIF}.tif"
  3. find . -iname '*.asc' -type f | xargs gdal_merge.py -o ${TARGET_DIR}_tif/${BIG_TIF}.tif -co "TILED=YES" -co "BLOCKXSIZE=512" -co "BLOCKYSIZE=512" -co "COMPRESS=DEFLATE" -co "ZLEVEL=9" -init -9999 -a_nodata -9999 -n -9999 -ot Int16  
  4.  
  5. echo "assigning srs to ${BIG_TIF}.tif"
  6. gdal_translate -a_nodata 0 -ot Int16  -a_srs "EPSG:2154" -co "TILED=YES" -co "BLOCKXSIZE=512" -co "BLOCKYSIZE=512" -co "COMPRESS=DEFLATE" -co "ZLEVEL=9" ${TARGET_DIR}_tif/${BIG_TIF}.tif ${TARGET_DIR}_tif/${BIG_TIF}_CRS.tif
  7. mv ${TARGET_DIR}_tif/${BIG_TIF}_CRS.tif ${TARGET_DIR}_tif/${BIG_TIF}.tif
  8.  
  9. echo "building pyramid"
  10. mkdir $TARGET_DIR
  11. gdal_retile.py -v -r bilinear -levels 6 -ps 2048 2048  -ot Int16 -co TILED=YES -co COMPRESS=DEFLATE -targetDir $TARGET_DIR ${TARGET_DIR}_tif/${BIG_TIF}.tif
  12.  
  13. cd $TARGET_DIR
  14. mkdir 0
  15. mv *.tif 0/
  16.  
  17. cd -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement