Re: New AddOns for downloading and importing Sentinel products
Stefan Blumentrath <[email protected]>
| Newsgroups | gmane.comp.gis.grass.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Martin, Very nice work! This will simplify some of my workflows significantly! One parameter I was missing was however "area_relation". Please find attached a diff, in case you agree that it would be a useful addition (the python script is successfully tested, though I did not check the html changes). Two things I was wondering are: 1. it might make sense to also provide the "url" as an option, cause there are some national mirrors of ESAs scihub around (at least this is the case for Norway) that expose the same API but are faster / cause have less traffic. What do you think? 2. the tools currently only support Sentinel-2, right. Do you plan to extend them to Sentinel-1/3... in future? Cheers Stefan -----Original Message----- From: grass-user [mailto:[email protected]] On Behalf Of Martin Landa Sent: fredag 26. januar 2018 23.36 To: GRASS users list <[email protected]> Subject: [GRASS-user] New AddOns for downloading and importing Sentinel products Hi, today I have uploaded a new toolset for downloading and importing Sentinel products, namely two modules: r.sentinel.download [1] and r.sentinel.import [2]. The first module requires Sentinelsat and Pandas library, the second GDAL with OpenJPEG. Testing and feedback welcome! Enjoy, Ma [1] https://grass.osgeo.org/grass72/manuals/addons/r.sentinel.download.html [2] https://grass.osgeo.org/grass72/manuals/addons/r.sentinel.import.html -- Martin Landa http://geo.fsv.cvut.cz/gwiki/Landa http://gismentors.cz/mentors/landa _______________________________________________ grass-user mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/grass-user _______________________________________________ grass-user mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/grass-user
r.sentinel.diff
(application/octet-stream, 3 KB)
Index: grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.html
===================================================================
--- grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.html (revision 72193)
+++ grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.html (working copy)
@@ -12,11 +12,20 @@
<p>
By default Sentinel products are sorted by <i>cloudcoverpercentage</i>
-and <i>ingestiondate</i> (see <b>sort</b> option). Only products which
-footprint intersects current computation region extent are
-filtered. The extent can be optionally defined also by
-vector <b>map</b>. Filtered products can be reduced by <b>limit</b>
-option.
+and <i>ingestiondate</i> (see <b>sort</b> option). By default,
+only products which footprint intersects current computation region
+extent (area of interest, AOI) are filtered. The AOI can be optionally
+defined also by vector <b>map</b>. In addition the spatial relation
+between AOI and the footprint (<b>area_relation</b>) can be set to
+<ul>
+<li></li><i>Contains</i>: to only return scenes where the AOI is contained
+inside the footprint</li>
+<li><i>IsWithin</i>: to only return scenes where the footprint is
+contained inside the AOI</li>
+<li><i>Intersects</i>: to return all scenes where the footprint
+intersects the AOI (default)</li>
+</ul>
+Filtered products can be reduced by <b>limit</b> option.
<p>
Module searches for products in last 60 days, exact date range can be
Index: grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.py
===================================================================
--- grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.py (revision 72193)
+++ grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.py (working copy)
@@ -27,6 +27,14 @@
#% required: no
#%end
#%option
+#% key: area_relation
+#% type: string
+#% description: Spatial reation of footprint to AOI
+#% options: Intersects,Contains,IsWithin
+#% answer: Intersects
+#% required: no
+#%end
+#%option
#% key: clouds
#% type: integer
#% description: Maximum cloud cover percentage for Sentinel scene
@@ -143,7 +151,7 @@
self._products_df_sorted = None
- def filter(self, area,
+ def filter(self, area, area_relation,
clouds=None, producttype=None, limit=None,
start=None, end=None, sortby=[], asc=True):
args = {}
@@ -160,7 +168,7 @@
else:
end = end.replace('-', '')
products = self._api.query(
- area=area,
+ area=area, area_relation=area_relation,
platformname='Sentinel-2',
date=(start, end),
**args
@@ -272,6 +280,7 @@
downloader = SentinelDownloader(options['user'], options['password'])
downloader.filter(area=map_box,
+ area_relation=options['area_relation'],
clouds=options['clouds'],
producttype=options['producttype'],
limit=options['limit'],