我有在南非跟踪的一种动物的拉丁数据,我正在使用adehabitatHR进行分析。以下是我的数据样本:
Latitude Longitude
-25.870265 27.947412
-25.816235 28.022442
-25.751107 28.1113
-25.670537 28.185403
-25.619823 28.290013我需要转换我的数据,这样我才能确定家的范围。我一直在使用本教程来帮助我,他的数据看起来也是十进制的,R.htm,这是我的代码:
library(raster)
library(rgdal)
library(maptools)
library(adehabitatHR)
library(sp)
data <- read.csv("stackoverflowEg.csv", sep = ",", header = T)
head(data)
coordinates(data) <- c("X", "Y")
proj4string(data) <- CRS("+init=epsg:4326")
## I got the projected coordinate system from here [http://epsg.io/22235][1]
track <- spTransform(data, CRS("+proj=longlat +init=epsg:22235"))
summary(track)
cp <- mcp(track, percent=95)
cp问题是mcp的结果值太小(2.230023e-07),所以我认为我的预测做错了。任何帮助都将不胜感激。
发布于 2014-07-03 09:31:00
尝尝这个
coordinates(df) <- ~Longitude+Latitude
proj4string(df) <- CRS('+init=epsg:4326')
dfutm <- spTransform(df, CRS('+init=epsg:32735')) # utm 35S for SAfrica
dfutm
SpatialPoints:
Longitude Latitude
[1,] 594921.4 7138341
[2,] 602485.7 7144268
[3,] 611454.0 7151409
[4,] 618966.7 7160268
[5,] 629521.1 7165787
Coordinate Reference System (CRS) arguments: +init=epsg:32735 +proj=utm +zone=35 +south
+datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0

https://stackoverflow.com/questions/24505934
复制相似问题