roads
所属分类:其他
开发工具:R
文件大小:3415KB
下载次数:0
上传日期:2023-03-13 14:08:45
上 传 者:
sh-1993
说明: 路网模拟方法
(Road network simulation methods)
文件列表:
.Rbuildignore (284, 2023-06-26)
DESCRIPTION (2628, 2023-06-26)
LICENSE.md (10105, 2023-06-26)
NAMESPACE (579, 2023-06-26)
NEWS.md (1045, 2023-06-26)
R (0, 2023-06-26)
R\CLUSexample.R (1466, 2023-06-26)
R\buildSimList.R (7986, 2023-06-26)
R\buildSnapRoads.R (1633, 2023-06-26)
R\demoScen.R (2423, 2023-06-26)
R\getClosestRoad.R (3245, 2023-06-26)
R\getDistFromSource.R (7202, 2023-06-26)
R\getGraph.R (4634, 2023-06-26)
R\getLandingsFromTarget.R (13099, 2023-06-26)
R\lcpList.R (1185, 2023-06-26)
R\mstList.R (2278, 2023-06-26)
R\pathsToLines.R (5869, 2023-06-26)
R\plotRoads.R (2209, 2023-06-26)
R\prepExData.R (556, 2023-06-26)
R\projectRoads.R (14505, 2023-06-26)
R\rasterToLineSegments.R (5891, 2023-06-26)
R\rasterizeLine.R (1827, 2023-06-26)
R\roads-package.R (516, 2023-06-26)
R\shortestPaths.R (3299, 2023-06-26)
_pkgdown.yml (68, 2023-06-26)
cran-comments.md (909, 2023-06-26)
data-raw (0, 2023-06-26)
data-raw\CLUSexample.R (2618, 2023-06-26)
data-raw\demoScen.R (15327, 2023-06-26)
data-raw\hexlogo.R (1701, 2023-06-26)
data (0, 2023-06-26)
... ...
# roads
[![CRAN
status](https://www.r-pkg.org/badges/version/roads)](https://CRAN.R-project.org/package=roads)
[![R-CMD-check](https://github.com/LandSciTech/roads/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/LandSciTech/roads/actions/workflows/R-CMD-check.yaml)
The goal of roads is to simulate road development under resource
development scenarios.
## Installation
You can install the released version of roads from
[CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("roads")
```
And the development version from
[GitHub](https://github.com/LandSciTech/roads) with:
``` r
# install.packages("devtools")
devtools::install_github("LandSciTech/roads")
```
## Example
To simulate the development of roads three inputs are needed: the
current road network (roads), the locations that should be connected to
the road network (landings) and the cost of building roads across the
landscape (cost). Typically the roads and landings are `sf` objects or
`sp` Spatial\* objects and the cost is a raster.
``` r
library(roads)
library(raster)
#> Warning: package 'sp' was built under R version 4.2.3
# data set installed with roads package
demoScen <- prepExData(demoScen)
scen <- demoScen[[1]]
prRoads <- projectRoads(landings = scen$landings.points,
cost = scen$cost.rast,
roads = scen$road.line,
plotRoads = TRUE)
```
By default `projectRoads` uses a minimum spanning tree with least cost
paths algorithm (`roadMethod = "mst"`) to connect all landings to the
nearest existing road or other landing following the path with the
lowest cost. Other methods available are least cost path
(`roadMethod = "lcp"`) which connects each landing to the nearest road
via the least cost path but independent of other landings and snapping
(`roadMethod = "snap"`) which ignores both cost and other landings and
simply connects each landing to the nearest road “as the crow flies”
For more details on how to use the package see the vignette
`vignette("roads-vignette", package = "roads")`
# License
Copyright (C) 2021 Her Majesty the Queen in Right of Canada, as
represented by the Minister of Environment and Climate Change.
And
Copyright 2018 Province of British Columbia
Licensed under the Apache License, Version 2.0 (the “License”); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
近期下载者:
相关文件:
收藏者: