[GRASS-SVN] r57253 - grass-addons/grass7/vector/v.area.weigh
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jul 23 05:34:59 PDT 2013
Author: neteler
Date: 2013-07-23 05:34:58 -0700 (Tue, 23 Jul 2013)
New Revision: 57253
Modified:
grass-addons/grass7/vector/v.area.weigh/v.area.weigh.py
Log:
v.area.weigh: strip off mapset name for tmp output
Modified: grass-addons/grass7/vector/v.area.weigh/v.area.weigh.py
===================================================================
--- grass-addons/grass7/vector/v.area.weigh/v.area.weigh.py 2013-07-23 09:59:33 UTC (rev 57252)
+++ grass-addons/grass7/vector/v.area.weigh/v.area.weigh.py 2013-07-23 12:34:58 UTC (rev 57253)
@@ -73,19 +73,21 @@
grass.fatal(_("Column must be numeric"))
# rasterize with cats (will be base layer)
- rastertmp1 = "%s_%s_1" % (vector, tmpname)
+ # strip off mapset for tmp output
+ vector_basename = vector.split("@")[0]
+ rastertmp1 = "%s_%s_1" % (vector_basename, tmpname)
if grass.run_command('v.to.rast', input = vector, output = rastertmp1,
use = 'cat', quiet = True) != 0:
grass.fatal(_("An error occurred while converting vector to raster"))
# rasterize with column
- rastertmp2 = "%s_%s_2" % (vector, tmpname)
+ rastertmp2 = "%s_%s_2" % (vector_basename, tmpname)
if grass.run_command('v.to.rast', input = vector, output = rastertmp2,
use = 'attr', layer = layer, attrcolumn = column, quiet = True) != 0:
grass.fatal(_("An error occurred while converting vector to raster"))
# zonal statistics
- rastertmp3 = "%s_%s_3" % (vector, tmpname)
+ rastertmp3 = "%s_%s_3" % (vector_basename, tmpname)
if grass.run_command('r.statistics2', base = rastertmp1, cover = weight,
method = 'sum', output = rastertmp3, quiet = True) != 0:
grass.fatal(_("An error occurred while calculating zonal statistics"))
More information about the grass-commit
mailing list