Commit 6f92ef05 authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

SCL to JSON

parent 48a79859
...@@ -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
``` ```
...@@ -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'
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