[GRASS-SVN] r66483 - grass/trunk/scripts/r.import
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Oct 12 19:07:30 PDT 2015
Author: annakrat
Date: 2015-10-12 19:07:29 -0700 (Mon, 12 Oct 2015)
New Revision: 66483
Modified:
grass/trunk/scripts/r.import/r.import.html
grass/trunk/scripts/r.import/r.import.py
Log:
r.import: add r.in.gdal's -l flag
Modified: grass/trunk/scripts/r.import/r.import.html
===================================================================
--- grass/trunk/scripts/r.import/r.import.html 2015-10-13 01:30:35 UTC (rev 66482)
+++ grass/trunk/scripts/r.import/r.import.html 2015-10-13 02:07:29 UTC (rev 66483)
@@ -38,6 +38,9 @@
<b>nearest</b> or <b>bilinear</b>, linear features can become zigzag
features after reprojection.
+<p>
+For explanation of <b>-l</b> flag, please refer to <a href="r.in.gdal.html">r.in.gdal</a> manual.
+
<h2>KNOWN ISSUES</h2>
Option <b>extent</b>=<em>region</em> works only when dataset has different
projection than current location (<a href="r.proj.html">r.proj</a> is then used).
Modified: grass/trunk/scripts/r.import/r.import.py
===================================================================
--- grass/trunk/scripts/r.import/r.import.py 2015-10-13 01:30:35 UTC (rev 66482)
+++ grass/trunk/scripts/r.import/r.import.py 2015-10-13 02:07:29 UTC (rev 66483)
@@ -102,6 +102,10 @@
#% description: Do not perform region cropping optimization
#% guisection: Optional
#%end
+#%flag
+#% key: l
+#% description: Force Lat/Lon maps to fit into geographic coordinates (90N,S; 180E,W)
+#%end
import sys
@@ -186,10 +190,11 @@
os.environ['GISRC'] = str(tgtgisrc)
# try r.in.gdal directly first
+ additional_flags = 'l' if flags['l'] else ''
if grass.run_command('r.in.gdal', input=GDALdatasource, flags='j',
errors='status', quiet=True) == 0:
parameters = dict(input=GDALdatasource, output=output,
- memory=memory, flags='k')
+ memory=memory, flags='k' + additional_flags)
if bands:
parameters['band'] = bands
try:
@@ -213,7 +218,7 @@
# import into temp location
grass.verbose(_("Importing <%s> to temporary location...") % GDALdatasource)
parameters = dict(input=GDALdatasource, output=output,
- memory=memory, flags='k')
+ memory=memory, flags='k' + additional_flags)
if bands:
parameters['band'] = bands
try:
More information about the grass-commit
mailing list