[GRASS-SVN] r56569 - grass-addons/grass6/raster/r.out.maxent_swd
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jun 2 23:51:29 PDT 2013
Author: sbl
Date: 2013-06-02 23:51:29 -0700 (Sun, 02 Jun 2013)
New Revision: 56569
Modified:
grass-addons/grass6/raster/r.out.maxent_swd/r.out.maxent_swd
Log:
Bugfix for r.out.maxent_swd does not find parameter map
Modified: grass-addons/grass6/raster/r.out.maxent_swd/r.out.maxent_swd
===================================================================
--- grass-addons/grass6/raster/r.out.maxent_swd/r.out.maxent_swd 2013-06-03 05:36:42 UTC (rev 56568)
+++ grass-addons/grass6/raster/r.out.maxent_swd/r.out.maxent_swd 2013-06-03 06:51:29 UTC (rev 56569)
@@ -199,7 +199,7 @@
exit 1
fi
else
- parameter=$(echo "$EVP_MAPS" | tr ',' ' ' | tr '@' '#' | sed 's/.$//')
+ parameter=$(echo "$EVP_MAPS" | tr ',' ' ' | tr '@' '#')
fi
#
#Check if environmental parameter map(s) exist
@@ -208,7 +208,15 @@
do
#Check if parameter map file(s) exist
map_name=$(echo $p | cut -f1 -d'#' | tr -d ' ')
- mapset_name=$(echo $p | cut -f2 -d'#' | tr -d ' ')
+ mapset_name=$(echo $p | cut -f2 -d'#' -s | tr -d ' ')
+ if [ -z $mapset_name ] ; then
+ mapset_name=$MAPSET
+ eval `g.findfile element=cell file=${map_name} mapset=${mapset_name}`
+
+ if [ -z "$name" ] ; then
+ mapset_name=PERMANENT
+ fi
+ fi
#
eval `g.findfile element=cell file=${map_name} mapset=${mapset_name}`
if [ -z "$name" ] ; then
@@ -276,8 +284,18 @@
for s in $species
do
#Check if specie mask files exist
- specie_map_name=$(echo $p | cut -f1 -d'#' | tr -d ' ')
- specie_mapset_name=$(echo $p | cut -f2 -d'#' | tr -d ' ')
+ specie_map_name=$(echo $s | cut -f1 -d'#' | tr -d ' ')
+ specie_mapset_name=$(echo $s | cut -f2 -d'#' -s | tr -d ' ')
+ echo $specie_map_name
+ if [ -z $specie_mapset_name ] ; then
+ specie_mapset_name=$MAPSET
+ eval `g.findfile element=cell file=${map_name} mapset=${mapset_name}`
+
+ if [ -z "$name" ] ; then
+ specie_mapset_name=PERMANENT
+ fi
+ fi
+
#
eval `g.findfile element=cell file=${specie_map_name} mapset=${specie_mapset_name}`
if [ -z "$name" ] ; then
@@ -304,7 +322,7 @@
eval `g.findfile element=cell file=MASK mapset=${MAPSET}`
if [ "$name" = MASK ] ; then
g.message -v "A mask allready exists. Renaming existing mask to old_MASK..."
- g.rename rast=MASK${MAPSET},old_MASK --q
+ g.rename rast="MASK@${MAPSET}",old_MASK --q
fi
#
#Apply specie mask
More information about the grass-commit
mailing list