From c93143154489bdf5443f1ea2a12bb697864d50c7 Mon Sep 17 00:00:00 2001
From: see24 <39161074+see24@users.noreply.github.com>
Date: Wed, 26 Jun 2024 15:29:53 +0000
Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20LandSciT?=
=?UTF-8?q?ech/roads@9e216f482180dc9271f65732a704b9559f045a24=20?=
=?UTF-8?q?=F0=9F=9A=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apple-touch-icon-120x120.png | Bin 21024 -> 21024 bytes
apple-touch-icon-152x152.png | Bin 30924 -> 30924 bytes
apple-touch-icon-180x180.png | Bin 40677 -> 40677 bytes
apple-touch-icon-60x60.png | Bin 6777 -> 6777 bytes
apple-touch-icon-76x76.png | Bin 9864 -> 9864 bytes
apple-touch-icon.png | Bin 40677 -> 40677 bytes
articles/grade-penalty.html | 50 ++++++++++++++++++++++++-----------
favicon-16x16.png | Bin 1354 -> 1354 bytes
favicon-32x32.png | Bin 2646 -> 2646 bytes
news/index.html | 3 ++-
pkgdown.yml | 2 +-
reference/projectRoads.html | 4 +--
search.json | 2 +-
13 files changed, 41 insertions(+), 20 deletions(-)
diff --git a/apple-touch-icon-120x120.png b/apple-touch-icon-120x120.png
index fb48b05b98c763ebd8b0e1b5330d8c812fdfbb90..3c945d84857794b0e2011ef064acb02257fe528b 100644
GIT binary patch
delta 64
zcmZ3mgmJ+V#tGHz{4!=sw*7m%vFUAqpsAISg_Ws^wt<0_fq`vB+tbMnfeNUiKB{(+
JlQ#zD0{{U;6~_Po
delta 64
zcmZ3mgmJ+V#tGHze7xejjx3+DvFUAqpox{Cv6Ydrwt<0_fq`G&SH{T=feNUi_LqJ4
JPTm-p4*=P06}$id
diff --git a/apple-touch-icon-152x152.png b/apple-touch-icon-152x152.png
index 01fff8b60075268e2eaa13eeb3cffbab118723e2..9e681d7c5d966018ba30a00efae112835c8edaf7 100644
GIT binary patch
delta 64
zcmX@}k@3ttGHz{4(a3H=e8B*fg_T(A3Jv!phWC+rYrez+g6iZ{TE|3I$ZrS3#z4
JC&yOg0{{^$7JC2y
delta 64
zcmX@}k@3ttGHze7q7`)w@_XHq9&-G_f)?wlXr&HZZU In this tutorial we explore the To use the grade penalty function we need to supply a raster to the
gradePenaltyFn
by
+attempting to build roads to randomly selected locations in a
+mountainous region of British Columbia, Canada. While the elevation and
+landcover data used is real, the roads and landings are not and
+projected roads are not expected to match observed roads. In most real
+applications, an established existing road network will constrain the
+locations of new access roads. gradePenaltyFn
uses a
+simplified version of the grade penalty approach taken by Anderson and
+Nelson (2004) to penalize roads that go up steep slopes and encourage
+roads to follow the contours of the landscape.weightRaster
argument that contains elevation and has other
-barriers (eg water bodies) included in the raster as negative or NA
-values. In this example we will use an elevation and proportion water
-data set downloaded with the geodata
package and cropped to
-an example area in British Columbia, Canada that is included in the
-package.NA
values. In this example we will use an elevation and
+proportion water data set downloaded with the geodata
+package and cropped to an example area in British Columbia, Canada that
+is included in the package.
library(roads)
library(terra)
@@ -133,15 +143,16 @@
gradePenaltyFn
requires a single raster as input but
allows factors other than grade that will affect road construction to be
included in the raster as negative values and barriers where no road
-construction is possible to be included as NA values. In this example we
-will assume that road construction is impossible for cells where the
-proportion of water is > 50%. Then we set areas with less than 1%
-water to NA so that the grade penalty will still apply in this case. We
-also need to get the penalty for water crossing on to a similar scale as
-the grade penalty in this case we will assume the same base cost of
-$16178 and the same penalty of $504 for every percentage point increase
-in percent water. Note this is just an example and there are certainly
-better data sources for the locations and costs of stream crossings.
+construction is possible to be included as NA
values. In
+this example we will assume that road construction is impossible for
+cells where the proportion of water is > 50%. Then we set areas with
+less than 1% water to NA so that the grade penalty will still apply in
+this case. We also need to get the penalty for water crossing on to a
+similar scale as the grade penalty in this case we will assume the same
+base cost of $16178 and the same penalty of $504 for every percentage
+point increase in percent water. Note this is just an example and there
+are certainly better data sources for the locations and costs of stream
+crossings.
# set water to NA when a cell is > 50% water
wat_use <- classify(dem_example$ex_wat, matrix(c(0.5, 1, NA), nrow = 1))
@@ -252,7 +263,9 @@
the default value of limit
in
gradePenaltyFn()
. To avoid this we can increase
limit
or change limitWeight
to something other
-than NA
. Here we set limit = 30
.
+than NA
. Below we try both setting limit = 30
+and limitWeight = 40000^2
. Which have slightly different
+results.
rd_proj <- projectRoads(lnds, wt_rast, rd_in, weightFunction = gradePenaltyFn,
roadsInWeight = FALSE, roadMethod = "ilcp", limit = 30)
@@ -327,6 +340,13 @@
col = c(terra::map.pal("blues", 6) %>% rev(), terra::map.pal("oranges", 10)),
colNA = "grey50", mar = c(2, 2, 2, 8.5))
+
+References
+
+Anderson AE, Nelson J (2004) Projecting vector-based road networks
+with a shortest path algorithm. Canadian Journal of Forest Research
+34:1444–1457. https://doi.org/10.1139/x04-030
+
diff --git a/favicon-16x16.png b/favicon-16x16.png
index ee1be2c953c75109845a47a0480b3e083d242db6..f02f3d74e7789d47d561887840a01b1ac7b98801 100644
GIT binary patch
delta 64
zcmX@bb&6|405dzkEYloGYst;w%ubAgrdCFlRt84e1_o9J20y#5wN75eqJS#eaXrs+
I@@VR>lU}1_o9J2Aj{kXPUfroads 1.2.0Change default roadMethod
to "ilcp"
in projectRoads
Add ability to use a custom weightFunction
and add a weightFunction
gradePenaltyFn
that determines the grade between two cells
+Add a vignette and a demo data set dem_example
to show how gradePenaltyFn
can be used.
Change argument name from cost
to weightRaster
since it no longer represents a cost surface and can now be inputs to the weightFunction
. Also change roadsInCost
to roadsInWeight
.
returned roads are no longer unioned together.
Deprecate getDistFromSource
and use terra::distance
instead.
-Fix bug in getLandingsFromTarget and change so that patches are used for 0,1 rasters and ids are used otherwise using terra::as.polygons to make it faster.
+Fix bug in getLandingsFromTarget
and change so that patches are used for 0,1 rasters and ids are used otherwise using terra::as.polygons to make it faster.
CRAN release: 2023-06-24
diff --git a/pkgdown.yml b/pkgdown.yml index 0627012..f17f591 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -5,7 +5,7 @@ articles: grade-penalty: grade-penalty.html ReconstructRoadHistory: ReconstructRoadHistory.html roads-vignette: roads-vignette.html -last_built: 2024-06-26T14:13Z +last_built: 2024-06-26T15:29Z urls: reference: https://landscitech.github.io/roads/reference article: https://landscitech.github.io/roads/articles diff --git a/reference/projectRoads.html b/reference/projectRoads.html index 847034e..752a360 100644 --- a/reference/projectRoads.html +++ b/reference/projectRoads.html @@ -284,9 +284,9 @@