Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoSentinel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoSentinel
Commits
b57bfeab
Commit
b57bfeab
authored
Oct 05, 2018
by
Mario Chirinos Colunga
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge-crop
parent
f832816e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
64 deletions
+16
-64
L2AProductListExtractData.sh
tools/L2AProductListExtractData.sh
+0
-39
mergeImages.sh
tools/mergeImages.sh
+16
-25
No files found.
tools/L2AProductListExtractData.sh
View file @
b57bfeab
...
...
@@ -7,45 +7,6 @@ cd $PRODCUTSDIR
ls
*
.zip | parallel
--jobs
$JOBS
ExtractData.sh
{}
$JP2DIR
#for f in $(ls *.zip)
#do
# #S2A_MSIL2A_20170515T162341_N0205_R040_T16QBJ_20170515T163103.zip
# filepattern=$(echo $f | cut -d"_" -f6)"_"$(echo $f | cut -d"_" -f3)"_" #T16QBJ_20170515T162341_
# tile=$(echo $filepattern | cut -d"_" -f1) #T16QBJ
# datetime=$(echo $filepattern | cut -d"_" -f2) #20170515T162341
# dateText=$(echo $datetime | cut -d"T" -f1) #20170515
# outDir=$JP2DIR$dateText"/"
# filePrefix=$outDir$filepattern
# echo $filePrefix
# echo $outDir
# if [ ! -d $outDir ]; then
# mkdir $outDir
# fi
# if [ ! -e $filePrefix"TCI_10m.jp2" -o ! -e $filePrefix"TCI_20m.jp2" -o ! -e $filePrefix"SCL_20m.jp2" ]; then
# unzip -n -j $f *TCI_10m.jp2 *TCI_20m.jp2 *SCL_20m.jp2 -d $JP2DIR$dateText
# TCI10m=$outDir"L2A_"$filepattern"TCI_10m.jp2"
# TCI20m=$outDir"L2A_"$filepattern"TCI_20m.jp2"
# SCL20m=$outDir"L2A_"$filepattern"SCL_20m.jp2"
# if [ -e $TCI10m ]; then
# mv $TCI10m $filePrefix"TCI_10m.jp2"
# fi
# if [ -e $TCI20m ]; then
# mv $TCI20m $filePrefix"TCI_20m.jp2"
# fi
# if [ -e $SCL20m ]; then
# mv $SCL20m $filePrefix"SCL_20m.jp2"
# fi
# else
# echo PASS $f
# fi
#done
tools/mergeImages.sh
View file @
b57bfeab
...
...
@@ -4,26 +4,11 @@ POLYGON=$2 #Crop Window
BOX
=
$(
polygonToBox.py
"
$POLYGON
"
)
#cd $DIR
#ls *.jp2 | parallel --jobs 4 gdal_translate -projwin $BOX -projwin_srs WGS84 -ot Byte -of JPEG {} {}_
#DIRNAME=$(echo $DIR | cut -d"/" -f1)
#echo $DIRNAME
#if [ ! -e ../$DIRNAME"TCI_10m_cropedmerged.tif" ]; then
# echo "gdal_merge.py -o ../cropmerge/"$DIRNAME"TCI_10m_cropedmerged.tif" $(ls *TCI_10m.jp2_)
# gdal_merge.py -o ../cropmerge/$DIRNAME"TCI_10m_cropedmerged.tif" $(ls *TCI_10m.jp2_)
#else
# echo PASSING ../cropmerge/$DIRNAME"TCI_10m_cropedmerged.tif" FOUND
#fi
#cd ..
##------------------------------------------------------------------------------
cd
$DIR
DIRNAME
=
$(
echo
$DIR
|
cut
-d
"/"
-f1
)
echo
$DIRNAME
##------------------------------------------------------------------------------
MERGEDIMAGE
=
$DIRNAME
"TCI_10m_merged.tif"
if
[
!
-e
$MERGEDIMAGE
]
;
then
echo
"gdal_merge.py -o "
$MERGEDIMAGE
$(
ls
*
TCI_10m.jp2
)
...
...
@@ -38,17 +23,23 @@ if [ ! -e $CROPEDIMAGE ]; then
else
echo
PASSING
$CROPEDIMAGE
FOUND
fi
cd
..
# gdal_merge.py -o ../$DIRNAME".tif" $(ls *TCI_10m.jp2)
#if [ ! -e $dir".jp2" ]; then
# gdal_translate -projwin $BOX -projwin_srs WGS84 -ot Byte -of JPEG $dir".tif" $dir".jp2"
#fi
##------------------------------------------------------------------------------
MERGEDIMAGE
=
$DIRNAME
"SCL_20m_merged.tif"
if
[
!
-e
$MERGEDIMAGE
]
;
then
echo
"gdal_merge.py -o "
$MERGEDIMAGE
$(
ls
*
TCI_10m.jp2
)
gdal_merge.py
-o
$MERGEDIMAGE
$(
ls
*
TCI_10m.jp2
)
else
echo
PASSING
$MERGEDIMAGE
FOUND
fi
#rasterWkt.py "$POLYGON" $dir.jp2 $dir"_p.tif"
CROPEDIMAGE
=
../mergecrop/
$DIRNAME
"SCL_20m_merged.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 $DIR
find
.
-name
*
.xml
-type
f
-delete
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment