Title: | Processing Linear Features |
---|---|
Description: | Assists in the manipulation and processing of linear features with the help of the 'sf' package. Makes use of linear referencing to extract data from most shape files. Reference for this packages methods: Albeke, S.E. et al. (2010) <doi:10.1007/s10980-010-9528-4>. |
Authors: | Samuel Fay [aut], William Kirkpatrick [aut], Shannon E Albeke [aut, cre] |
Maintainer: | Shannon E Albeke <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.1 |
Built: | 2025-03-12 04:17:20 UTC |
Source: | https://gitlab.com/albekeecoinfolab/rlft |
Add M values to a given linear feature and store them in the m-coordinate of the sf object. Returns the new sf object with added m-values. For more information on m-values and linear referencing see: http://desktop.arcgis.com/en/arcmap/10.3/guide-books/linear-referencing/what-is-linear-referencing.htm
addMValues(sfDataObject)
addMValues(sfDataObject)
sfDataObject |
An sf object. Must be a LINESTRING, POLYGON, MULTIPOLYGON, or MULTILINESTRING |
Returns the new sfDataObject
with added m-values. The class of the output is sf
.
library(rLFT) data("shpObject") # Assign M Values to each vertex mValues <- addMValues(shpObject) print("M Values Added") head(st_coordinates(mValues))
library(rLFT) data("shpObject") # Assign M Values to each vertex mValues <- addMValues(shpObject) print("M Values Added") head(st_coordinates(mValues))
Calculates raw convexity, convexity index, and sinuosity of a given sf object and returns a data frame with all measurements for each step and feature. If provided, the data will also be output to a tab delimited file.
bct(sfDataObject, step, window, ridName = NULL, filename = "")
bct(sfDataObject, step, window, ridName = NULL, filename = "")
sfDataObject |
An sf Object containing shape file data. |
step |
A numeric describing the distance between measurements along an arc. |
window |
A numeric describing the diameter of the window used to measure convexity. |
ridName |
A character denoting the column name where the unique ID for each feature is stored in given sf object. |
filename |
A character denoting the name of the file you wish to output convexity data to in tab delimited format. Must have the .txt extension. |
This function will reject any sf object with a geographic coordinate system, so consider projecting your features. Your sf object must be of either type LINESTRING, MULTILINESTRING, POLYGON, or MULTIPOLYGON. If a given POLYGON or MUTLIPOLYGON contains inner rings, they will be ignored. If a unique ID Column name is not provided, the function will generate a unique ID for each feature. The arguments step
and window
can be any non-negative numeric. The argument ridName
MUST be a character indicating the name of the column in your sf object where the route id is stored.
The output of this function is a data.frame
that contains all measurements for each step and feature.
Albeke, S.E. et al. “Measuring boundary convexity at multiple spatial scales using a linear “moving window” analysis: an application to coastal river otter habitat selection.” Landscape Ecology 25 (2010): 1575-1587. [linked phrase](https://link.springer.com/article/10.1007/s10980-010-9528-4)
library(rLFT) data("shpObject") #store convexity output data in a variable 'outputTable' outputTable <- bct(shpObject, step = 50, window = 100, ridName = "RID")
library(rLFT) data("shpObject") #store convexity output data in a variable 'outputTable' outputTable <- bct(shpObject, step = 50, window = 100, ridName = "RID")
A dataset with coordinates (x, y, z) of 3 linear features with a geometry type of MULTIPOLYGON and a geographic coordinate system (longlat)
latlongShpObject
latlongShpObject
A data frame with 1 row and 10 variables
An example sf object with geometry type of POINT, used for testing.
pointObject
pointObject
An object of class sf
(inherits from data.frame
) with 1 rows and 2 columns.
A dataset with coordinates (x, y) of 37 features with a geometry type of POLYGON and a projected coordinate system (aea). These features represent the same data as 'shpObject' but this sf object has been cast to be of geometry type POLYGON. There are also inner polygons on some features.
polygonShpObject
polygonShpObject
A data frame with 37 rows and 2 variables
Id's of all features
coordinates of feature (x,y)
A dataset with coordinates (x, y) of 37 linear features with a geometry type of LINESTRING and a projected coordinate system (aea). These particular features represent several small islands in Alaska.
shpObject
shpObject
A data frame with 37 rows and 2 variables
Route ID of the features
coordinates of feature (x, y)