Commit a207a1d7 authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

parallel

parent 5b621090
......@@ -19,6 +19,7 @@ fi
rasterWkt.py "$POLYGON" $dir.jp2 $dir"_p.tif"
cd $DIR
find . -name *.xml -type f -delete
......
#!/bin/sh
JP2DIR=$1 #JP2 Directory
POLYGON=$2 #Crop Window
JOBS=${2:-1}
#BOX=$(python3 polygonToBox.py "$POLYGON")
#cd $JP2DIR
#for dir in *; do
# if [ -d ${dir} ]; then
# cd $dir
# if [ ! -e ../$dir".tif" ]; then
# echo "gdal_merge.py -o ../"$dir".tif" $(ls *.jp2)
# gdal_merge.py -o ../$dir".tif" $(ls *.jp2)
# fi
# cd ..
# if [ ! -e ../$dir".jp2" ]; then
# gdal_translate -projwin $BOX -projwin_srs WGS84 -ot Byte -of JPEG $dir".tif" $dir".jp2"
# fi
# rasterWkt.py "$POLYGON" $dir.jp2 $dir"_p.tif"
# echo $dir
# fi
#done
#cd $JP2DIR
#find . -name *.xml -type f -delete
if [ "$#" -le 2 ]; then
echo "Usage " $0 " <Parent Directory with subdirectories> <POLYGON> [jobs]"
exit
fi
cd $JP2DIR
ls ls -d */ | parallel --jobs $JOBS MergeImges.sh {} $POLYGON
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment