ring_area | R Documentation |
geojson area function
ring_area(x)
x |
A list of coordinates. See examples for its form |
ported from geojson-aera
JS library at
https://github.com/mapbox/geojson-area
Calculate the approximate area of the polygon were it projected onto the earth. Note that this area will be positive if ring is oriented clockwise, otherwise it will be negative.
Reference: Robert. G. Chamberlain and William H. Duquette, "Some Algorithms for Polygons on a Sphere", JPL Publication 07-03, Jet Propulsion Laboratory, Pasadena, CA, June 2007 http://trs-new.jpl.nasa.gov/dspace/handle/2014/40409
single integer - The approximate signed geodesic area of the polygon in square meters. Positive if ring is oriented clockwise, otherwise it will be negative.
x <- '{ "type":"Polygon", "coordinates":[ [[100.0,0.0],[100.0,1.0],[101.0,1.0],[101.0,0.0],[100.0,0.0]] ] }' x <- jsonlite::fromJSON(x, FALSE) ring_area(x = x$coordinates[[1]]) ring_area(x = rev(x$coordinates[[1]]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.