Description Usage Arguments Details Value Examples
View source: R/geobuffer_points.R
geobuffer_points helps in creating geodesic buffers of points represented by longitude and latitude coordinates.
1 2 | geobuffer_points(data, radius, by_point = FALSE, n_segments = 100,
wrap_antimeridian = FALSE)
|
data |
matrix of geographic unprojected coordinates (i.e., in EPSG:4326). Columns must be "longitude" and "latitude", in that order. |
radius |
(numeric) radius of buffer in meters. |
by_point |
(logical) whether or not to do buffers by point. If FALSE, the default, buffer polygons that overlap will be dissolved to obtain an only feature. Default = 100. |
n_segments |
(numeric) number of segments to approximate a circle. |
wrap_antimeridian |
(logical) whether or not to wrap buffers in the antimeridian when they overpass it. |
The process is done using an algorithm that calculates the buffer in the North Pole and then rotates this buffer into the actual location. The rotation is effected by converting the original buffer to geocentric Cartesian (XYZ) coordinates. A matrix multiplication helps to rotate those coordinates along the Prime Meridian to the target latitude, converting the coordinates back to Geographic (WGS84). Then the buffer is spun around the Earth's axis by adding the target longitude to each second coordinate.
The algorithm was developed by a moderator of the Geographic Information Systems Stack Exchange (online community). More details are available available at the following site.
A SpatialPolygons object of buffered points. Final projection is WGS84 (EPSG:4326).
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.