computeClipBufferForCONUS: USGS Lidar Toolkit - Compute buffer size(s) to correct for...

View source: R/UtilityFunctions.R

computeClipBufferForCONUSR Documentation

USGS Lidar Toolkit – Compute buffer size(s) to correct for distance distortions associated with the web Mercator projection (EPSG:3857)

Description

The web Mercator projection does not maintain accurate distances. The distortions increase as you move away from the equator so a correction is needed to produce sample areas that are consistent in size for a set of samples across a range latitudes.

Usage

computeClipBufferForCONUS(
  desiredBuffer,
  centerPointLatitude = NULL,
  points = NULL
)

Arguments

desiredBuffer

A single numeric value defining the desired buffer size or a vector of numeric values with the desired buffer sizes. If a vector of sizes is provided, it must be the same length as the vector provided for centerPointLatitude.

centerPointLatitude

A single numeric value or vector of values containing the latitude of the sample points.

points

A SpatialPoints* or sf object containing the sample point locations. The object must contain a coordinate system definition corresponding to the web Mercator projection. The points will be projected into NAD83 lon-lat and the resulting latitude values will be used to compute the buffer size(s).

Details

computeClipBufferForCONUS uses a correction multiplier developed for latitudes ranging from 23-49 degrees by comparing 1000m squares defined in the web Mercator projection to their size when reprojected into UTM. While this is still not a perfect solution, it provides a correction factor that gets you very close to the desired sample size.

Value

A single value that is the buffer width needed to produce the desiredBuffer or a vector of buffer widths needed to produce the desiredBuffer for each sample point.

Examples

## Not run: 
computeClipBufferForCONUS(1000, 41.5)

## End(Not run)

bmcgaughey1/USGSlidar documentation built on June 23, 2024, 1:25 a.m.