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

merge-crop

parent 2418d229
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
def extractSentielData(filename, destination):
"unzip -n -j "+filename+" *TCI_10m.jp2 *TCI_20m.jp2 *SCL_20m.jp2 -d "+ destination+"/"+date+
mv $TCI10m $filePrefix"TCI_10m.jp2"
def main(argv):
if len(sys.argv) != 2:
print("Usage: " + argv[0] + " <JSON File>")
else:
jsonFile=open(argv[1]).read()
cfg = json.loads(jsonFile)
extractSentielData(filename, destination)
if __name__ == "__main__":
main(sys.argv)
...@@ -24,15 +24,20 @@ BOX=$(polygonToBox.py "$POLYGON") ...@@ -24,15 +24,20 @@ BOX=$(polygonToBox.py "$POLYGON")
cd $DIR cd $DIR
DIRNAME=$(echo $DIR | cut -d"/" -f1) DIRNAME=$(echo $DIR | cut -d"/" -f1)
echo $DIRNAME echo $DIRNAME
if [ ! -e $DIRNAME"TCI_10m_merged.tif" ]; then MERGEDIMAGE=$DIRNAME"TCI_10m_merged.tif"
echo "gdal_merge.py -o "$DIRNAME"TCI_10m_merged.tif" $(ls *TCI_10m.jp2) if [ ! -e $MERGEDIMAGE ]; then
gdal_merge.py -o $DIRNAME"TCI_10m_merged.tif" $(ls *TCI_10m.jp2) echo "gdal_merge.py -o "$MERGEDIMAGE $(ls *TCI_10m.jp2)
gdal_merge.py -o $MERGEDIMAGE $(ls *TCI_10m.jp2)
else else
echo PASSING $DIRNAME"TCI_10m_merged.tif" FOUND echo PASSING $MERGEDIMAGE FOUND
fi fi
gdal_translate -projwin $BOX -projwin_srs WGS84 -ot Byte -of JPEG $DIRNAME"TCI_10m_merged.tif" ../mergecrop/$DIRNAME"TCI_10m_mergedcroped.tif" CROPEDIMAGE=../mergecrop/$DIRNAME"TCI_10m_mergedcroped.tif"
if [ ! -e $CROPEDIMAGE ]; then
gdal_translate -projwin $BOX -projwin_srs WGS84 -ot Byte -of JPEG $MERGEDIMAGE $CROPEDIMAGE
else
echo PASSING $CROPEDIMAGE FOUND
fi
cd .. cd ..
# gdal_merge.py -o ../$DIRNAME".tif" $(ls *TCI_10m.jp2) # gdal_merge.py -o ../$DIRNAME".tif" $(ls *TCI_10m.jp2)
......
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