[GRASS-SVN] r53112 - grass-addons/grass6/raster/r.connectivity.distance
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Sep 7 00:14:18 PDT 2012
Author: sbl
Date: 2012-09-07 00:14:18 -0700 (Fri, 07 Sep 2012)
New Revision: 53112
Modified:
grass-addons/grass6/raster/r.connectivity.distance/Makefile
grass-addons/grass6/raster/r.connectivity.distance/description.html
grass-addons/grass6/raster/r.connectivity.distance/r.connectivity.distance
Log:
Set svn properties, check for FOLDER and fix euclidean distance measure bug
Property changes on: grass-addons/grass6/raster/r.connectivity.distance/Makefile
___________________________________________________________________
Deleted: svn:executable
- *
Added: keywords
+ Stefan Blumentrath 30.08.2012 sbl
Added: eol-style
+ native
Modified: grass-addons/grass6/raster/r.connectivity.distance/description.html
===================================================================
--- grass-addons/grass6/raster/r.connectivity.distance/description.html 2012-09-06 18:59:29 UTC (rev 53111)
+++ grass-addons/grass6/raster/r.connectivity.distance/description.html 2012-09-07 07:14:18 UTC (rev 53112)
@@ -1,69 +1,3 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>GRASS GIS manual: r.connectivity.distance</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="grassdocs.css" type="text/css">
-</head>
-<body bgcolor="white">
-
-<img src="grass_logo.png" alt="GRASS logo"><hr align=center size=6 noshade>
-
-<h2>NAME</h2>
-<em><b>r.connectivity.distance</b></em> - Compute cost-distance between all polygons (patches) of an input vector map within a user defined euclidean distance threshold
-<h2>KEYWORDS</h2>
-<dl>
-raster, vector, connectivity, distance, network
-</dl>
-
-<h2>SYNOPSIS</h2>
-<b>r.connectivity.distance</b><br>
-<b>r.connectivity.distance help</b><br>
-<b>r.connectivity.distance</b> [-<b>ste</b>] <b>patches</b>=<em>patches (input)</em> [<b>costs</b>=<em>costs (input)</em>] <b>pop_proxy</b>=<em>pop_proxy</em> <b>prefix</b>=<em>string</em> <b>folder</b>=<em>string</em> [<b>cutoff</b>=<em>float</em>] [<b>border_dist</b>=<em>integer</em>] [--<b>verbose</b>] [--<b>quiet</b>]
-
-<h3>Flags:</h3>
-<dl>
-<dt><b>-s</b></dt>
-<dd>Extract and save short paths and closest points into a vector map</dd>
-
-<dt><b>-t</b></dt>
-<dd>Rasterize patches with "all-touched" option using GDAL (can useful for narrow patches). This can be time consuming.</dd>
-
-<dt><b>-e</b></dt>
-<dd>Use euclidean distance (not cost distance)</dd>
-
-<dt><b>--verbose</b></dt>
-<dd>Verbose module output</dd>
-<dt><b>--quiet</b></dt>
-<dd>Quiet module output</dd>
-</dl>
-
-<h3>Parameters:</h3>
-<dl>
-<dt><b>folder</b>=<em>string</em></dt>
-<dd>Folder where all (non map) output from r.connectivity.* is stored (output)</dd>
-
-<dt><b>patches</b>=<em>string</em></dt>
-<dd>Name of input vector map containing patches (input)</dd>
-
-<dt><b>costs</b>=<em>string</em></dt>
-<dd>Name of input costs raster map (input)</dd>
-
-<dt><b>pop_proxy</b>=<em>string</em></dt>
-<dd>Column containig proxy for population size (attribute values must be numeric and neither values <= 0 nor NULL allowed!)</dd>
-
-<dt><b>prefix</b>=<em>string</em></dt>
-<dd>Prefix for output maps of the r.connectivity.*-tools. Also temporary data uses this prefix.</dd>
-
-<dt><b>cutoff</b>=<em>float</em></dt>
-<dd>Maximum euclidean search distance around patches in map units</dd>
-<dd>Default: <em>10000</em></dd>
-
-<dt><b>border_dist</b>=<em>integer</em></dt>
-<dd>Number of border cells used for distance measuring</dd>
-<dd>Default: <em>50</em></dd>
-</dl>
-
<h2>DESCRIPTION</h2>
Recently, graph-theory has been characterised as an efficient and useful tool for conservation planning (e.g. Bunn et al. 2000, Calabrese & Fagan 2004, Minor et al. 2008, Zetterberg et. al. 2010). As a part of the r.connectivity.* tool-chain, r.connectivity.distance is intended to make graph-theory more easily available to conservation planning.
@@ -75,8 +9,8 @@
The edge-list csv-file structure (edges.csv) looks like this:
<dl>
<dd><em><b>from_patch,to_patch,cost-distance</b></em></dd>
-<dd><em>1,2,150</em></dd>
-<dd><em>1,3,75</em></dd>
+<dd><em>1;2;150</em></dd>
+<dd><em>1;3;75</em></dd>
<dd><em>...</em></dd>
</dl>
<dl>
@@ -106,13 +40,12 @@
<h2>SEE ALSO</h2>
-<a href="r.connectivity.network">r.connectivity.network</a>, <a href="r.connectivity.corridors">r.connectivity.corridors</a><br>
+<em><a href="r.connectivity.network">r.connectivity.network</a>,
+<a href="r.connectivity.corridors">r.connectivity.corridors</a>
+</em>
+<br>
-
<h2>AUTHOR</h2>
Stefan Blumentrath, Norwegian Institute for Nature Research (NINA)
-
-<i>Last changed: $Date$</i>
-
-</body>
-</html>
+<br><br>
+<p><i>Last changed: $Date$</i>
Property changes on: grass-addons/grass6/raster/r.connectivity.distance/description.html
___________________________________________________________________
Deleted: svn:executable
- *
Added: mime-type
+ text/html
Added: keywords
+ Stefan Blumentrath 30.08.2012 sbl
Added: eol-style
+ native
Modified: grass-addons/grass6/raster/r.connectivity.distance/r.connectivity.distance
===================================================================
--- grass-addons/grass6/raster/r.connectivity.distance/r.connectivity.distance 2012-09-06 18:59:29 UTC (rev 53111)
+++ grass-addons/grass6/raster/r.connectivity.distance/r.connectivity.distance 2012-09-07 07:14:18 UTC (rev 53112)
@@ -26,8 +26,8 @@
# The edge-list csv-file structure (edges.csv) looks like this:
#
# from_patch,to_patch,cost-distance
-# 1,2,150
-# 1,3,75
+# 1;2;150
+# 1;3;75
# ...
#
# The vertex-list consists of two parts:
@@ -282,8 +282,11 @@
########################################################################
-
-eval `g.region -ugp rast=$COSTS align=$COSTS`
+if [ $E_FLAG -ne 1 ] ; then
+ eval `g.region -ugp rast=$COSTS align=$COSTS`
+else
+ eval `g.region -ugp`
+fi
max_n=$n
min_s=$s
max_e=$e
@@ -390,7 +393,11 @@
fi
#Set region to start-patch
- g.region -u --quiet vect=${PREFIX}_patch_${p} n=n+$cost_nsres s=s-$cost_nsres e=e+$cost_ewres w=w-$cost_ewres align=$COSTS save="${PREFIX}_${p}" --overwrite
+ if [ $E_FLAG -ne 1 ] ; then
+ g.region -u --quiet vect=${PREFIX}_patch_${p} n=n+$cost_nsres s=s-$cost_nsres e=e+$cost_ewres w=w-$cost_ewres align=$COSTS save="${PREFIX}_${p}" --overwrite
+ else
+ g.region -u --quiet vect=${PREFIX}_patch_${p} n=n+$cost_nsres s=s-$cost_nsres e=e+$cost_ewres w=w-$cost_ewres save="${PREFIX}_${p}" --overwrite
+ fi
WIND_OVERRIDE="${PREFIX}_${p}"
export WIND_OVERRIDE
@@ -413,7 +420,11 @@
############################################
#awk
############################################
- eval `g.region -ugp --quiet n=n+$CUTOFF s=s-$CUTOFF e=e+$CUTOFF w=w-$CUTOFF align=$COSTS`
+ if [ $E_FLAG -ne 1 ] ; then
+ eval `g.region -ugp --quiet n=n+$CUTOFF s=s-$CUTOFF e=e+$CUTOFF w=w-$CUTOFF align=$COSTS`
+ else
+ eval `g.region -ugp --quiet n=n+$CUTOFF s=s-$CUTOFF e=e+$CUTOFF w=w-$CUTOFF`
+ fi
n_test=$(echo $n $max_n | awk '{if($1 < $2) print $2}')
if [ $n_test ] ; then
n=$n
@@ -439,7 +450,11 @@
w=$min_w
fi
- g.region -u --quiet n=$n s=$s e=$e w=$w align=$COSTS save="${PREFIX}_${p}_buffer" --overwrite
+ if [ $E_FLAG -ne 1 ] ; then
+ g.region -u --quiet n=$n s=$s e=$e w=$w align=$COSTS save="${PREFIX}_${p}_buffer" --overwrite
+ else
+ g.region -u --quiet n=$n s=$s e=$e w=$w save="${PREFIX}_${p}_buffer" --overwrite
+ fi
WIND_OVERRIDE="${PREFIX}_${p}_buffer"
export WIND_OVERRIDE
@@ -551,5 +566,9 @@
done
#Remove external temporary data
-rm -f ${FOLDER}/tmp
-rm -f ${FOLDER}/tmp_part
+if [ -z "$FOLDER" ] ; then
+ rm -f ${FOLDER}/tmp
+ rm -f ${FOLDER}/tmp_part
+else
+ g.message -w "Could not find folder ${FOLDER}"
+fi
Property changes on: grass-addons/grass6/raster/r.connectivity.distance/r.connectivity.distance
___________________________________________________________________
Added: keywords
+ Stefan Blumentrath 30.08.2012 sbl
Added: eol-style
+ native
More information about the grass-commit
mailing list