Skip to content

Commit

Permalink
add suggestion to fix 'gdalsrsinfo -o epsg' error with old GDAL versions
Browse files Browse the repository at this point in the history
  • Loading branch information
msterk committed Jun 23, 2021
1 parent 7d20235 commit 66c31dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions batch/batch-merge-tiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ mkdir -p $OUTPUT_DIR
#collect all input files and group them into directories named after their CRS
for T in $(find $INPUT_DIR -name '*.tif'); do
CRS=$(gdalsrsinfo $T -o epsg |grep -i 'epsg:' | sed 's/.*\://')
#Older versions of gdalsrsinfo will return a warning or error with '-o epsg' option.
#In this case you MUST replace the above line with:
#CRS=$(gdalsrsinfo $T -o proj4 | shasum | awk '{print $1;}')
CRS_DIR=$OUTPUT_DIR/$CRS.crs
mkdir -p $CRS_DIR
cp $T $CRS_DIR/$(echo $T | tr '/' '_')
Expand Down

0 comments on commit 66c31dc

Please sign in to comment.