Commit 8db18b6e authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

readme MD

parent e12c660d
...@@ -29,8 +29,24 @@ sentinel.downloadProducts(products,".") ...@@ -29,8 +29,24 @@ sentinel.downloadProducts(products,".")
``` ```
## WKT Polygon bounding box (`geosentinel/polygonToBox.py`) ## WKT Polygon bounding box (`geosentinel/polygonToBox.py`)
Some times you may have a WKT Polygon string that is to log for sentinel API to accept, in this caase you can use this script to obtain the bounding box of the polygon and use it in Some times you may have a WKT Polygon string that is to long for sentinel API to accept, in this case you can use this script to obtain the bounding box of the polygon and use it with **APISentinel**. This script also has the option to be used with ``gdal_translate`` id the second parameter is set to **False** .
### Example
```python
from geosentinel import APISentinel
from geosentinel import polygonToBox
sentinel = APISentinel('username', 'password')
merida = "POLYGON((-89.99450683593753 21.279137394108716,-89.13757324218751 21.2996106049456,-89.30236816406251 20.68418377935238,-90.0494384765625 20.715015145512098,-89.99450683593753 21.279137394108716))"
products = sentinel.getProducts(polygonToBox.getWKTPolygonBoundingBox(merida, True), ('20150101', '20181024'), {"platformname":"Sentinel-2", "cloudcoverpercentage":"[0 TO 40]"})
sentinel.downloadProducts(products,".")
```
```bash
merida = "POLYGON((-89.99450683593753 21.279137394108716,-89.13757324218751 21.2996106049456,-89.30236816406251 20.68418377935238,-90.0494384765625 20.715015145512098,-89.99450683593753 21.279137394108716))"
BOX=$(python3 $HOME/GeoSentinel/geosentinel/polygonToBox.py "$merida")
gdal_translate -projwin $BOX -projwin_srs WGS84 -ot Byte -scale 0 4096 0 255 -of JPEG filein.tiff fileout.jpg
```
## L2A Product generation (`tools/L1CProductListToL2A.sh`) ## L2A Product generation (`tools/L1CProductListToL2A.sh`)
This script uses [Sen2Cor](http://step.esa.int/main/third-party-plugins-2/sen2cor/) to convert all L1C products in a directory to L2C products. The script takes as an arguments the name of the a directory with a `L1C` Subdirectory where the products are located and the number of jobs to run in parallel. This script uses [Sen2Cor](http://step.esa.int/main/third-party-plugins-2/sen2cor/) to convert all L1C products in a directory to L2C products. The script takes as an arguments the name of the a directory with a `L1C` Subdirectory where the products are located and the number of jobs to run in parallel.
......
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