sp_area | R Documentation |
If the spatial-polygons are projected in a system with a metre unit,
rgeos::gArea
is used to calculate the area of the polygons. If the
projection system is WGS84, a trigonometric function is used
(geosphere::areaPolygon
). Although using a projection system with
metres yields the most accurate results, the geosphere::areaPolygon
function has been tested and performs well.
sp_area(sp, unit = "m", features = TRUE)
sp |
Spatial-polygons object. |
unit |
Unit of returned area. Can be "m", "km", or "ha". Default is "m". |
features |
Should the individual areas of the features contained within
|
Stuart K. Grange
## Not run:
# Calculate the area of the Greater London Built-up area, sp is projected
in OSGB36, a metric projection system
sp_area(sp_built_up_london, unit = "km")
1737.855
# Wikipedia says the same
# https://en.wikipedia.org/wiki/Greater_London_Built-up_Area
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.