[GRASS-SVN] r72197 - grass-addons/grass7/raster/r.sentinel/r.sentinel.import
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jan 29 07:56:12 PST 2018
Author: martinl
Date: 2018-01-29 07:56:12 -0800 (Mon, 29 Jan 2018)
New Revision: 72197
Modified:
grass-addons/grass7/raster/r.sentinel/r.sentinel.import/r.sentinel.import.py
Log:
r.sentinel.import: resample bilinear if running r.import
Modified: grass-addons/grass7/raster/r.sentinel/r.sentinel.import/r.sentinel.import.py
===================================================================
--- grass-addons/grass7/raster/r.sentinel/r.sentinel.import/r.sentinel.import.py 2018-01-29 15:49:52 UTC (rev 72196)
+++ grass-addons/grass7/raster/r.sentinel/r.sentinel.import/r.sentinel.import.py 2018-01-29 15:56:12 UTC (rev 72197)
@@ -83,11 +83,13 @@
return files
def import_products(self, reproject=False, link=False):
+ args = {}
if link:
module = 'r.external'
else:
if reproject:
module = 'r.import'
+ args['resample'] = 'bilinear'
else:
module = 'r.in.gdal'
@@ -97,7 +99,7 @@
gs.fatal('Projection of dataset does not appear to match current location. '
'Force reprojecting dataset by -r flag.')
- self._import_file(f, module)
+ self._import_file(f, module, args)
def _check_projection(self, filename):
try:
@@ -113,11 +115,11 @@
return True
- def _import_file(self, filename, module):
+ def _import_file(self, filename, module, args):
mapname = os.path.splitext(os.path.basename(filename))[0]
gs.message('Processing <{}>...'.format(mapname))
try:
- gs.run_command(module, input=filename, output=mapname)
+ gs.run_command(module, input=filename, output=mapname, **args)
except CalledModuleError as e:
pass # error already printed
More information about the grass-commit
mailing list