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
5b3f258f
Commit
5b3f258f
authored
Aug 24, 2018
by
Mario Chirinos Colunga
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
date directory
parent
95422c1c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
30 deletions
+45
-30
L2AproductListToRGB.sh
tools/L2AproductListToRGB.sh
+45
-30
No files found.
tools/L2AproductListToRGB.sh
View file @
5b3f258f
...
@@ -9,14 +9,21 @@ break
...
@@ -9,14 +9,21 @@ break
cd
$PRODCUTSDIR
cd
$PRODCUTSDIR
for
f
in
$(
find
.
-type
f
-name
'*.zip'
)
for
f
in
$(
find
.
-type
f
-name
'*.zip'
)
do
do
#S2A_MSIL2A_20170515T162341_N0205_R040_T16QBJ_20170515T163103.zip
filepattern
=
$(
echo
$f
|
cut
-d
"_"
-f6
)
"_"
$(
echo
$f
|
cut
-d
"_"
-f3
)
"_"
filepattern
=
$(
echo
$f
|
cut
-d
"_"
-f6
)
"_"
$(
echo
$f
|
cut
-d
"_"
-f3
)
"_"
#T16QBJ_20170515T162341_
filename
=
$JP2DIR$filepattern
filename
=
$JP2DIR$filepattern
fileout1
=
$(
echo
$filepattern
|
cut
-d
"_"
-f1
)
#T16QBJ
fileout2
=
$(
echo
$filepattern
|
cut
-d
"_"
-f2
)
#20170515T162341
dateText
=
$(
echo
$filepattern
|
cut
-d
"T"
-f1
)
#20170515
echo
$filename
echo
$filename
if
[
!
-d
$JP2DIR$dateText
]
;
then
mkdir
$JP2DIR$dateText
fi
if
[
!
-e
$filename
"TCI_10m.jp2"
]
;
then
if
[
!
-e
$filename
"TCI_10m.jp2"
]
;
then
unzip
-n
-j
$f
*
TCI_10m.jp2
-d
$JP2DIR
unzip
-n
-j
$f
*
TCI_10m.jp2
-d
$JP2DIR
$dateText
/
L2ANAME
=
$JP2DIR
"
L2A_"
$filepattern
"TCI_10m.jp2"
L2ANAME
=
$JP2DIR
$dateText
"/
L2A_"
$filepattern
"TCI_10m.jp2"
if
[
-e
$L2ANAME
]
;
then
if
[
-e
$L2ANAME
]
;
then
mv
$L2ANAME
$filename
"TCI_10m.jp2"
mv
$L2ANAME
$filename
"TCI_10m.jp2"
fi
fi
...
@@ -24,37 +31,45 @@ do
...
@@ -24,37 +31,45 @@ do
echo
PASS
$f
echo
PASS
$f
fi
fi
RGBCROPED
=
$JP2DIR
"rgbCroped/"
#
RGBCROPED=$JP2DIR"rgbCroped/"
if
[
!
-d
$RGBCROPED
]
;
then
#
if [ ! -d $RGBCROPED ]; then
mkdir
$RGBCROPED
#
mkdir $RGBCROPED
fi
#
fi
fileout1
=
$(
echo
$filepattern
|
cut
-d
"_"
-f1
)
fileout2
=
$(
echo
$filepattern
|
cut
-d
"_"
-f2
)
if
[
!
-d
$RGBCROPED$fileout1
]
;
then
#
mkdir
$RGBCROPED$fileout1
fi
# if [ ! -d $dateText$fileout1 ]; then
echo
$BOX
# mkdir $dateText$fileout1
OUTIMG
=
$JP2DIR
"rgbCroped/"
$fileout1
/
$fileout2
"_"
$fileout1
"_10m.tiff"
OUTIMG_P
=
$JP2DIR
"rgbCroped/"
$fileout1
/
$fileout2
"_"
$fileout1
"_10m_p.tiff"
# if [ ! -e $OUTIMG ]; then
gdal_translate
-projwin
$BOX
-projwin_srs
WGS84
-ot
Byte
-of
JPEG
$filename
"TCI_10m.jp2"
$OUTIMG
rasterWkt.py
"
$POLYGON
"
$OUTIMG
$OUTIMG_P
rm
polygonTmp.tiff
# wktToShape.py "$POLYGON" myShape.shp
# gdal_rasterize -b 1 -b 2 -b 3 -burn 10 -burn 200 -burn 10 -l wtk myShape.shp $OUTIMG
# rm myShape.*
## convert rgb/$fileout1/$fileout2"_"$fileout1"_t.jpg" -resize 640x480\! rgb/$fileout1/$fileout2"_"$fileout1".jpg"
## rm rgb/$fileout1/$fileout2"_"$fileout1"_t.jpg"
# fi
# fi
# echo $BOX
# OUTIMG=$JP2DIR"rgbCroped/"$dateText/$fileout2"_"$fileout1"_10m.tiff"
# OUTIMG_P=$JP2DIR"rgbCroped/"$dateText/$fileout2"_"$fileout1"_10m_p.tiff"
## if [ ! -e $OUTIMG ]; then
# cd $PRODCUTSDIR
# #Converts raster data between different formats.
break
# gdal_translate -projwin $BOX -projwin_srs WGS84 -ot Byte -of JPEG $filename"TCI_10m.jp2" $OUTIMG
# rasterWkt.py "$POLYGON" $OUTIMG $OUTIMG_P
# rm polygonTmp.tiff
## wktToShape.py "$POLYGON" myShape.shp
## gdal_rasterize -b 1 -b 2 -b 3 -burn 10 -burn 200 -burn 10 -l wtk myShape.shp $OUTIMG
## rm myShape.*
### convert rgb/$fileout1/$fileout2"_"$fileout1"_t.jpg" -resize 640x480\! rgb/$fileout1/$fileout2"_"$fileout1".jpg"
### rm rgb/$fileout1/$fileout2"_"$fileout1"_t.jpg"
## fi
## cd $PRODCUTSDIR
# break
done
done
#cd $PRODCUTSDIR
#for f in $(find . -type f -name '*.zip')
#do
#done
cd
$JP2DIR
cd
$JP2DIR
find
.
-name
*
.xml
-type
f
-delete
find
.
-name
*
.xml
-type
f
-delete
#find . -name myShape.* -type f -delete
#find . -name myShape.* -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