[GRASS-SVN] r72199 - grass-addons/grass7/raster/r.sentinel/r.sentinel.download

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jan 29 09:04:17 PST 2018


Author: martinl
Date: 2018-01-29 09:04:17 -0800 (Mon, 29 Jan 2018)
New Revision: 72199

Modified:
   grass-addons/grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.html
   grass-addons/grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.py
Log:
r.sentinel.import: area_relation option added (patch provided by Stefan Blumentrath)

Modified: grass-addons/grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.html
===================================================================
--- grass-addons/grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.html	2018-01-29 16:12:39 UTC (rev 72198)
+++ grass-addons/grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.html	2018-01-29 17:04:17 UTC (rev 72199)
@@ -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

Modified: grass-addons/grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.py
===================================================================
--- grass-addons/grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.py	2018-01-29 16:12:39 UTC (rev 72198)
+++ grass-addons/grass7/raster/r.sentinel/r.sentinel.download/r.sentinel.download.py	2018-01-29 17:04:17 UTC (rev 72199)
@@ -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'],



More information about the grass-commit mailing list