MyNixOS website logo
Description

Processing Linear Features.

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>.

Linear Feature Tools (rLFT)

The goal of rLFT is to assist users in extracting data from linear features and shp files. This is accomplished with the help of the sf package and by utilizing linear referencing. Linear referencing gives us a way to collect data as points on a line rather than using (x,y) coordinates. We can then use measurements along features to locate these points. This method of collecting data has a wide variety of applications and can be used in various ways. For more information on linear referencing see ArcGIS’s definition

Available Linear Feature Tools:

  • Boundary Convexity Tool: This tool calculates the relative degree of convexity or concavity at locations along line segments (specifically, “routes”) as well as the sinuosity of the line segment. The original need for creating the BCT was to characterize the degree of convexity (or concavity) at specific locations along a coastline in order to assess the potential for use of these areas by coastal river otters. It is suspected that these otters use convex sites (points that jut out into the water) as preferred latrine sites because the wind can more easily carry their scent. Many landscapes have linear boundaries whose shape may be important to animal movement and/or use. To calculate boundary convexity, we need to recognize that the value is ‘scale-dependent’. For example, a portion of coastline inside a bay may appear convex in shape (jutting into the ocean) from the perspective of 25 meters on either side of a given point, but concave at a broader view of 500 meters on either side. As such, this tool was developed to quantify convexity at a series of points along a route, with a user-defined window-size (distance to consider either direction from the point of measurement). This is essentially a “moving window” analysis for line features.

Installation

You can install the released version of rLFT from CRAN with:

install.packages("rLFT")

Example

This is a basic example:

library(rLFT)
## Loading in data from shp file. If you want to use your own shp file
## use the sf library function st_read("directory of desired shp file").
## For more information on the sf package see: https://cran.r-project.org/web/packages/sf/index.html
# data("shpObject")
outputTable <- bct(shpObject, 50, 100)
#>    user  system elapsed 
#>    0.04    0.00    0.05

View the resulting data from “bct()” of the first 10 rows:

head(outputTable, 10)
#>    RID StepSize WindowSize RawConvexity ConvexityIndex Sinuosity
#> 1    1        0        100       28.549          0.571     0.635
#> 2    1       50        100      -18.641         -0.373     0.578
#> 3    1      100        100      -19.891         -0.398     0.625
#> 4    1      150        100       24.944          0.499     0.623
#> 5    1      200        100        2.458          0.049     0.501
#> 6    1      250        100        9.879          0.198     0.512
#> 7    1      300        100       -4.640         -0.093     0.513
#> 8    1      350        100       -6.607         -0.132     0.553
#> 9    1      400        100      -19.972         -0.399     0.600
#> 10   1      450        100       -1.041         -0.021     0.517
#>    Midpoint X Midpoint Y
#> 1    354048.5    1226757
#> 2    354045.2    1226806
#> 3    354010.6    1226834
#> 4    353967.2    1226824
#> 5    353935.4    1226862
#> 6    353907.5    1226904
#> 7    353898.0    1226953
#> 8    353879.9    1226997
#> 9    353853.1    1227031
#> 10   353803.7    1227031

If you want to view the entire table use:

View(outputTable)

Here is a map view of the sf Object that was used to get the above data (accessed using the mapview library):

Metadata

Version

1.0.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows