[GRASS-SVN] r62451 - grass-addons/grass7/raster/r.in.srtm.region
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Oct 28 14:16:20 PDT 2014
Author: mmetz
Date: 2014-10-28 14:16:20 -0700 (Tue, 28 Oct 2014)
New Revision: 62451
Modified:
grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.html
grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.py
Log:
r.in.srtm.region update
Modified: grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.html
===================================================================
--- grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.html 2014-10-28 19:33:11 UTC (rev 62450)
+++ grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.html 2014-10-28 21:16:20 UTC (rev 62451)
@@ -5,12 +5,12 @@
patches the tiles together and optionally interpolates holes for
SRTM V2.1.
<p>
-<em>r.in.srtm.region</em> downloads SRTM V2.1 tiles from:<br>
+<em>r.in.srtm.region</em> downloads SRTM V3 tiles from:<br>
+<a href="http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/2000.02.11/">http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/2000.02.11/</a>
+<br>
+and SRTM V2.1 tiles from:
<a href="http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/">http://dds.cr.usgs.gov/srtm/</a>
<br>
-and SRTM V3 tiles from:
-<a href="http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/2000.02.11/">http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/2000.02.11/</a>
-<br>
or optionally uses a local folder with previously downloaded files if
the <b>local</b> option is given.
Modified: grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.py
===================================================================
--- grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.py 2014-10-28 19:33:11 UTC (rev 62450)
+++ grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.py 2014-10-28 21:16:20 UTC (rev 62451)
@@ -57,8 +57,9 @@
#% description: Fill null cells
#%end
#%flag
-#% key: 3
-#% description: Import SRTM v3 tiles
+#% key: 2
+#% label: Import SRTM v2 tiles
+#% description: Default: Import SRTM v3 tiles
#%end
@@ -160,8 +161,8 @@
return
os.chdir(currdir)
grass.run_command('g.region', region = tmpregionname)
- grass.run_command('g.remove', region = tmpregionname, quiet = True)
- #grass.try_rmdir(tmpdir)
+ grass.run_command('g.remove', type = 'region', pattern = tmpregionname, flags = 'f', quiet = True)
+ grass.try_rmdir(tmpdir)
def main():
global tile, tmpdir, in_temp, currdir, tmpregionname
@@ -173,7 +174,7 @@
output = options['output']
memory = options['memory']
fillnulls = flags['n']
- srtmv3 = flags['3']
+ srtmv3 = (flags['2'] == 0)
if srtmv3:
fillnulls = 0
@@ -320,7 +321,7 @@
# g.mlist with sep = comma does not work ???
pattern = '*.r.in.srtm.tmp.%d' % pid
- srtmtiles = grass.read_command('g.mlist',
+ srtmtiles = grass.read_command('g.list',
type = 'rast',
pattern = pattern,
sep = 'newline',
@@ -330,7 +331,7 @@
srtmtiles = ','.join(srtmtiles)
if valid_tiles == 0:
- grass.run_command('g.remove', rast = str(srtmtiles), quiet = True)
+ grass.run_command('g.remove', type = 'rast', pattern = str(srtmtiles), flags = 'f', quiet = True)
grass.warning(_("No tiles imported"))
if local != tmpdir:
grass.fatal(_("Please check if local folder <%s> is correct.") % local)
@@ -363,11 +364,11 @@
output = output + '.float',
flags = 'z')
grass.run_command('r.mapcalc', expression = '%s = round(%s)' % (output, output + '.float'))
- grass.run_command('g.remove',
- rast = '%s,%s,%s' % (output + '.holes', output + '.interp', output + '.float'),
+ grass.run_command('g.remove', type = 'rast',
+ pattern = '%s,%s,%s' % (output + '.holes', output + '.interp', output + '.float'),
quiet = True)
- grass.run_command('g.mremove', rast = pattern, flags = 'f', quiet = True)
+ grass.run_command('g.remove', type = 'rast', pattern = pattern, flags = 'f', quiet = True)
# nice color table
grass.run_command('r.colors', map = output, color = 'srtm', quiet = True)
More information about the grass-commit
mailing list