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
6f92ef05
Commit
6f92ef05
authored
Oct 05, 2018
by
Mario Chirinos Colunga
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCL to JSON
parent
48a79859
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
README.md
README.md
+6
-4
SCLimageListToJSON.sh
tools/SCLimageListToJSON.sh
+3
-1
No files found.
README.md
View file @
6f92ef05
...
@@ -124,17 +124,19 @@ This script uses `gdal_merge.py` and `gdal_translate` to merge all the images w
...
@@ -124,17 +124,19 @@ This script uses `gdal_merge.py` and `gdal_translate` to merge all the images w
mergeImagesByDirectory.sh /home/geoint/NAS/images/
mergeImagesByDirectory.sh /home/geoint/NAS/images/
```
```
## Count Total Area for Each L2A SCL Class (`geosentinel/L2ASCLtoJSON`)
## Count Total Area for Each L2A SCL Class (`geosentinel/L2ASCLtoJSON` and `tools/SCLimageListToJSON.sh`)
This script count the total number of each of the 12 classes in a SCL image form a Sentinel-2 L2A product.
*L2ASCLtoJSON.py*
script will count the total number of each of the 12 classes in a SCL image form a Sentinel-2 L2A product.
*SCLimageListToJSON.sh*
script will do the same for each tif image in a directory.
```
json
```
json
{
{
"wkt"
:
"POLYGON((-89.62955474853516 21.05230266883862,-89.55093383789061 21.05230266883862,-89.52930450439452 20.965126493194475,-89.6484375 20.873408465645696,-89.72877502441405 20.95294341625548,-89.65805053710938 21.056788298627097,-89.62955474853516 21.05230266883862))"
,
"wkt"
:
"POLYGON((-89.62955474853516 21.05230266883862,-89.55093383789061 21.05230266883862,-89.52930450439452 20.965126493194475,-89.6484375 20.873408465645696,-89.72877502441405 20.95294341625548,-89.65805053710938 21.056788298627097,-89.62955474853516 21.05230266883862))"
,
"filename"
:
"/home/geoint/NAS/data/mergecrop/20180214SCL_20m.tif"
}
}
```
```
```
bash
```
bash
L2ASCLtoJSON.py meridaSCL.json
>
SCLresult.json
L2ASCLtoJSON.py
/home/geoint/NAS/data/20180214_SCL_20m.tif
meridaSCL.json
>
SCLresult.json
```
```
tools/SCLimageListToJSON.sh
View file @
6f92ef05
...
@@ -4,4 +4,6 @@ CGF=$2
...
@@ -4,4 +4,6 @@ CGF=$2
JOBS
=
${
3
:-
1
}
JOBS
=
${
3
:-
1
}
cd
$DIR
cd
$DIR
ls
*
_SCL_20m.tif | parallel
--jobs
$JOBS
L2ASCLtoJSON.py
{}
$2
ls
*
.tif | parallel
--jobs
$JOBS
'L2ASCLtoJSON.py '
{}
' $2 > $(echo '
{}
' | cut -d"." -f1).json'
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