Search code examples
rpolygonarear-sp

R sp: unit of area of Polygon


I use R to read in a shape file to analyse with the sp package polygons of oilfields (longitude-latitude with WGS84) and their respective areas. Unfortunately I do not know the unit of the area output. E.g. the area output is on average 0.85 units (max 4.34) which probably is not in square kilometers since this would be much too small for oilfields.

Does anyone know the unit of the area output of Polygons in the sp package? Many thanks!


Solution

  • To get a correct area computation for a polygon in lat-lon coordinates, it would be better to convert them to a metric equal-area projection using "spTransform" beforehand. Alternatively, you could use package geosphere which allows to do

    "Spherical trigonometry for geographic applications. That is, compute distances and re- lated measures for angular (longitude/latitude) locations"

    For example, this:

    require(geosphere)
    areaPolygon(mypoly)
    

    (with mypoly being a spatialPolygons object) will give you its area in square kilometers.

    HTH.