Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r.connectivity.distance: implement walking distance and parallel processing #1108

Open
wants to merge 3 commits into
base: grass8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
<h2>DESCRIPTION:</h2>
<em>r.connectivity.distance</em> computes cost-distance between all
<em>r.connectivity.distance</em> computes cost-distances between all
areas (patches) of an input vector map within a user defined Euclidean
distance threshold.

<p>Recently, graph-theory has been characterised as an efficient and
<p>
Recently, graph-theory has been characterised as an efficient and
useful tool for conservation planning (e.g. Bunn et al. 2000,
Calabrese &amp; Fagan 2004, Minor &amp; Urban 2008, Zetterberg et. al. 2010).</p>
Calabrese &amp; Fagan 2004, Minor &amp; Urban 2008, Zetterberg et. al. 2010).

<p>As a part of the r.connectivity.* tool-chain, <em>r.connectivity.distance</em> is
intended to make graph-theory more easily available to conservation
planning.</p>
<p>
As a part of the r.connectivity.* tool-chain,
<em>r.connectivity.distance</em> is intended to make graph-theory more
easily available to conservation planning.

<p><em>r.connectivity.distance</em> is the first tool of the
<p>
<em>r.connectivity.distance</em> is the first tool of the
r.connectivity.*-toolchain (followed by <em>r.connectivity.network</em>
and <em>r.connectivity.corridors</em>).</p>
and <em>r.connectivity.corridors</em>).

<p><em>r.connectivity.distance</em> loops through all polygons in the
<p>
<em>r.connectivity.distance</em> loops through all polygons in the
input vector map and calculates the cost-distance to all the other
polygons within a user-defined Euclidean distance threshold.</p>
polygons within a user-defined Euclidean distance threshold.

<p>It produces two vector maps that hold the network:</p>
<p>
It produces two vector maps that hold the network:
<ul>
<li>an edge-map (connections between patches) and a</li>
<li>vertex-map (centroid representations of the patches).</li>
<li>an edge-map (connections between patches) and,</li>
<li>a vertex-map (centroid representations of the patches).</li>
</ul>

<p>Attributes of the edge-map are:</p>
<table>
<p>
Attributes of the edge-map are:

<p>
<table border='1'>
<tr>
<td>cat</td>
<td>line category</td>
Expand Down Expand Up @@ -58,41 +66,49 @@ <h2>DESCRIPTION:</h2>
</tr>
<tr>
<td>pop_proxy</td>
<td>the user defined population proxy to be used in further analysis,
representing a proxy for the amount of organisms potentially dispersing
from a patch (e.g. habitat area)</td>
<td>the user defined population proxy to be used<br>
in further analysis, representing a proxy for<br>
the amount of organisms potentially dispersing<br>
from a patch (e.g. habitat area)</td>
<td>double precision</td>
</tr>
</table>

<p>On user request (<b>p-flag</b>) the shortest paths between the possible
<p>
On user request (<b>p-flag</b>) the shortest paths between the possible
combination of patches can be extracted (using <em>r.drain</em>), along
with start and stop points.</p>
with start and stop points.

<p>In addition, <em>r.connectivity.distance</em> outputs a cost distance
raster map for every input area which later on are used in
<em>r.connectivity.corridors</em> (together with output from
<em>r.connectivity.network</em>) for corridor identification.</p>
<p>
In addition, <em>r.connectivity.distance</em> outputs a cost distance
raster map for every input area. These are used later on in
<em>r.connectivity.corridors</em> (together with the output of
<em>r.connectivity.network</em>) for corridor identification.

<p>Distance between patches is measured as border to border distance. With
<p>
Distance between patches is measured as border to border distance. With
the <b>border_dist</b> option, the user can define the number of cells
(n) along the border to be used for distance measuring.<br>
(n) along the border to be used for distance measuring.

<p>
The distance from a (start) patch to another (end) is measured as the
n-th closest cell on the border of the other (end) patch. An increased
number of border cells used for distance measuring also increases the
width of possible corridors computed with
<em>r.connectivity.corridors</em> later on.</p>
<em>r.connectivity.corridors</em> later on.

<p>If an output directory is given for the <b>conefor_dir</b> option is
<p>
If an output directory is given for the <b>conefor_dir</b> option is
specified, also output suitable for further processing in
<a href="http://www.conefor.org">CONEFOR</a> will be produced, namely:</p>
<a href="http://www.conefor.org">CONEFOR</a> will be produced, namely:
<ul>
<li>a node file</li>
<li>a directed connection file, and</li>
<li>an undirected connection file</li>
</ul>

<h2>EXAMPLES</h2>

The following example is based on the North Carolina dataset!
<p><em>Please be aware that all input parameters of the following example are
purely hypothetical (though they intend to imitate a real life
Expand All @@ -107,9 +123,9 @@ <h2>EXAMPLES</h2>
the borders are no suitable habitats.<br>
It is not the most mobile of species and can cover (under optimal
conditions) maximal 1.5 km.
</p>

<h3>Prepare input data</h3>

Before we can run the connectivity analysis with the r.connectivity.*-tools
we need to prepare the example input data. Because we want to use
cost distance as a distance measure we have to provide a cost raster map
Expand Down Expand Up @@ -137,10 +153,7 @@ <h3>Create input patch vector map</h3>
landuse96_28m==11,1,null())"

# Vectorize patches
r.to.vect input=patches output=patches feature=area

# Add a column for the population proxy (in this case area in hectares)
v.db.addcolumn map=patches layer=1 columns="area_ha double precision"
r.to.vect input=patches output=patches type=area

# Upload area to attribute table (later used as population proxy)
v.to.db map=patches type=point,line,boundary,centroid layer=1 qlayer=1 \
Expand All @@ -162,14 +175,17 @@ <h3>Create input patch vector map</h3>
<h3>Create a cost raster:</h3>
(see also: <em>r.cost</em>)

<p>For the cost raster, we assume that areas which are developed with
<p>
For the cost raster, we assume that areas which are developed with
high intensity are absolute barriers for our species (not crossable at all).<br>
Other developed and managed areas can be crossed, but only at high costs
(they are avoided where possible). Other Hardwood landcover types offer
best opportunity for the dispersal of our species (they are preferred),
while the costs for crossing the other landcover types is somewhere
in between.</p>
<p>Hint: One might also add infrastructure like e.g. roads</p>
in between.

<p>
Hint: One might also add infrastructure like e.g. roads

<div class="code"><pre>
# Reclassify land use map
Expand All @@ -190,9 +206,10 @@ <h3>Create a cost raster:</h3>
18 = 28 #Mixed Hardwoods/Conifers (1*resolution (28m))
20 = 42 #Water Bodies (1,5*resolution (28m))
21 = 84 #Unconsolidated Sediment (3*resolution (28m))' | r.reclass \
input=landuse96_28m output=costs rules=- --overwrite
input=landuse96_28m output=costs rules=-
</pre></div>

<p>
<div style="margin: 10px">
<a href="r_connectivity_distance_costs.png">
<img src="r_connectivity_distance_costs.png" width="600" height="600"
Expand All @@ -205,22 +222,24 @@ <h3>Create a cost raster:</h3>
<h3>Create the network</h3>
In the first step the network dataset is created, and the cost distance
between all possible pairs of vertices (patches) is calculated.
<p>Our species is known to be unable to cover more than 1.5 km distance.
<p>
Our species is known to be unable to cover more than 1.5 km distance.
In order to identify potential for improving the connectivity of the
landscape for our species we set the cutoff distance (maximum search
distance for connections) to three times dispersal potential of our
species (4500). In lack of real population data we use the area (ha) as
a proxy. The distance between two patches is measured as the maximum
distance along the closest 500m of boundary of a patch (ca. 18 border
cells with 28m resolution). We store the resulting network data also
in a format that is suitable as input to CONEFOR software.</p>
in a format that is suitable as input to CONEFOR software.

<div class="code"><pre>
r.connectivity.distance -t -p input=patches_1ha pop_proxy=area_ha \
costs=costs prefix=hws_connectivity cutoff=4500 border_dist=18 \
conefor_dir=./conefor
</pre></div>

<p>
<div style="margin: 10px">
<a href="r_connectivity_distance_shortest_paths.png">
<img src="r_connectivity_distance_shortest_paths.png" width="600"
Expand All @@ -230,6 +249,7 @@ <h3>Create the network</h3>
represented by shortest paths and patch areas, produced in the example above.</i>
</div>

<p>
<div style="margin: 10px">
<a href="r_connectivity_distance_network.png">
<img src="r_connectivity_distance_network.png" width="600" height="600"
Expand All @@ -239,8 +259,9 @@ <h3>Create the network</h3>
visualisation with straight lines, produced in the example above.</i>
</div>

<p>To be continued with <a href="r.connectivity.network.html">
r.connectivity.network</a>!</p>
<p>
To be continued with <a href="r.connectivity.network.html">
r.connectivity.network</a>!

<h2>REFERENCE</h2>
<dl>
Expand Down
Loading
Loading