1

given a set of coordinates

 lat <- c(47.2325618, 47.2328269, 47.2330041, 47.2330481, 47.2330914, 
          47.2331172, 47.2331291, 47.2331499)
 lon <- c(11.3707441, 11.3707791, 11.3708087, 11.3708031, 11.3707818, 
          11.3707337, 11.3706588, 11.370284)
coords <- cbind(lon,lat)

I want to calculate the area of the polygon. I use the function areapl() from package splancs:

library(splancs)
areapl(coords)
# [1] 1.4768e-07

this leaves me with a dimension in degrees squared (?). so my question is: how do i convert this into metres/kilometres?

thanks a lot in advance.

Josh O'Brien
  • 159,210
  • 26
  • 366
  • 455
Seb
  • 5,417
  • 7
  • 31
  • 50
  • You first have to project that lat/long into metres, and then calculate the area. – nograpes Sep 27 '12 at 14:42
  • @nograpes Thank you for your answer but honestly: I haven't got the slightest clue how to convert this ;) sorry! – Seb Sep 28 '12 at 06:19

1 Answers1

5

Either convert to a cartesian grid system (eg a UTM zone) using spTransform in the sp package, or try areaPolygon in the geosphere package.

> areaPolygon(coords)
[1] 7688.568
Spacedman
  • 92,590
  • 12
  • 140
  • 224