dist.lu.ecors: Distance to Land Use class

View source: R/dist.lu.ecors.R

dist.lu.ecorsR Documentation

Distance to Land Use class

Description

Calculates the minimum or average distance of reference polygons (site, samples, polygons - as defined in function get.lu.ecors) to pixels of a given land use class in each year.

Usage

dist.lu.ecors(
  x,
  class.value,
  stat.dist,
  max.dist,
  focal = F,
  window.radius = NULL
)

Arguments

x

lu.ecors object (from get.lu.ecors).

class.value

select a land use class (number).

stat.dist

select "min" or "mean" statistics.

max.dist

Maximum assessed distance (m). Very large values can take a long time to process or generate errors.

focal

should use moving window (kernel) to remove atypical pixels (isolated pixels)? Pixels in the moving window are replaced by the "mode" value in the area.

window.radius

radius of moving window (m).

Details

The use of "focal" preprocessing is recommended, mainly with the use of minimum distance statistics, since a single isolated pixel caused by misclassification can seriously compromise the result. However, it is important to assess whether this procedure is not removing real data. Linear features such as gallery forests or water bodies are particularly susceptible to be removed by this technique. Always visually evaluate the result of the focal technique with the plot.focal.ecors function before running dist.lu.ecors. Buffers will not be used in this analysis. Distance will be computed from the original polygons.

Value

List with result tables and metadata.

Examples

# Get a lu.ecors class object
FAL.IBGE.JBB<-sf::st_read(system.file("extdata/FAL.IBGE.JBB.gpkg", package="ecors"))
test.points<-sf::st_read(system.file("extdata/Points_tests.gpkg", package="ecors"))
test.retangles<-sf::st_read(system.file("extdata/Plots_tests.gpkg", package="ecors"))

# Get lu.ecors object (buffer size will not be considered in dist.lu.ecors)
lu2000_2010<-get.lu.ecors(site=FAL.IBGE.JBB, points=test.points, plots=test.retangles,
     polygons=NULL, id.column=1, projected=F, custom.crs=32723,
     collection.lu="mapbiomas6", years=c(2000,2010), resolution=30, evaluate="distance.samples",
     buffer1=NULL, buffer2=NULL, buffer3=NULL, cumulative.surroundings=F)
     #if you set evaluate to "surroundings.samples" the result will be the same, but will spend extra time to generate bufferes (do not used here).

dist_to_3<-dist.lu.ecors(x=lu2000_2010, class.value=3, stat.dist="mean",
                           max.dist=5000, focal=T, window.radius=90)

fredtaka/ecors documentation built on Aug. 26, 2022, 6:58 a.m.