给定一组坐标
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)
Run Code Online (Sandbox Code Playgroud)
我想计算多边形的面积.我使用areapl()包splancs中的函数:
library(splancs)
areapl(coords)
# [1] 1.4768e-07
Run Code Online (Sandbox Code Playgroud)
这给我留下了平方度(?)的维度.所以我的问题是:我如何将其转换为米/公里?
非常感谢提前.
要么转换为使用笛卡尔网格系统(如UTM区)spTransform的sp包,或尝试areaPolygon在geosphere包中.
> areaPolygon(coords)
[1] 7688.568
Run Code Online (Sandbox Code Playgroud)