[GRASS-SVN] r55077 - grass-addons/grass7/raster/r.in.srtm.region
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Feb 16 06:44:14 PST 2013
Author: mmetz
Date: 2013-02-16 06:44:14 -0800 (Sat, 16 Feb 2013)
New Revision: 55077
Modified:
grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.py
Log:
r.in.srtm.region small bugfixes
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 2013-02-16 13:50:02 UTC (rev 55076)
+++ grass-addons/grass7/raster/r.in.srtm.region/r.in.srtm.region.py 2013-02-16 14:44:14 UTC (rev 55077)
@@ -197,22 +197,30 @@
north = tmpint + 1
else:
north = tmpint
+
tmpint = int(south)
if tmpint > south:
south = tmpint - 1
else:
south = tmpint
+
tmpint = int(east)
if tmpint < east:
east = tmpint + 1
else:
east = tmpint
+
tmpint = int(west)
if tmpint > west:
west = tmpint - 1
else:
west = tmpint
+ if north == south:
+ north += 1
+ if east == west:
+ east += 1
+
rows = abs(north - south)
cols = abs(east - west)
ntiles = rows * cols
@@ -274,11 +282,12 @@
grass.run_command('g.region', region = tmpregionname)
- # g.mlist with fs = comma does not work ???
+ # g.mlist with sep = comma does not work ???
+ pattern = '*.r.in.srtm2.tmp.%d' % pid
srtmtiles = grass.read_command('g.mlist',
type = 'rast',
- pattern = '*.r.in.srtm2.tmp.%d' % pid,
- fs = 'newline',
+ pattern = pattern,
+ sep = 'newline',
quiet = True)
srtmtiles = srtmtiles.splitlines()
@@ -322,7 +331,7 @@
rast = '%s,%s,%s' % (output + '.holes', output + '.interp', output + '.float'),
quiet = True)
- grass.run_command('g.remove', rast = str(srtmtiles), quiet = True)
+ grass.run_command('g.mremove', rast = 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