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
f832816e
Commit
f832816e
authored
Oct 05, 2018
by
Mario Chirinos Colunga
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge-crop
parent
2418d229
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
extractData.py
geosentinel/extractData.py
+19
-0
mergeImages.sh
tools/mergeImages.sh
+11
-6
No files found.
geosentinel/extractData.py
View file @
f832816e
#!/usr/bin/python
# -*- 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
)
tools/mergeImages.sh
View file @
f832816e
...
...
@@ -24,15 +24,20 @@ BOX=$(polygonToBox.py "$POLYGON")
cd
$DIR
DIRNAME
=
$(
echo
$DIR
|
cut
-d
"/"
-f1
)
echo
$DIRNAME
if
[
!
-e
$DIRNAME
"TCI_10m_merged.tif"
]
;
then
echo
"gdal_merge.py -o "
$DIRNAME
"TCI_10m_merged.tif"
$(
ls
*
TCI_10m.jp2
)
gdal_merge.py
-o
$DIRNAME
"TCI_10m_merged.tif"
$(
ls
*
TCI_10m.jp2
)
MERGEDIMAGE
=
$DIRNAME
"TCI_10m_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
$
DIRNAME
"TCI_10m_merged.tif"
FOUND
echo
PASSING
$
MERGEDIMAGE
FOUND
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
..
# gdal_merge.py -o ../$DIRNAME".tif" $(ls *TCI_10m.jp2)
...
...
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