![](/img/trans.png)
[英]changing projection of raster stack from HKH albers equal area conis to wgs84 in R
[英]Changing WGS84 to EPSG:5330 in R
我想将坐标形式WGS84更改为EPSG:5330。 希望任何人都可以帮助我,谢谢
ID,X,Y
1,106.6874498,-6.2107887
2,106.6883199,-6.2069667
使用sp
库轻松自如。
library(sp)
# Create SpatialPoints out of coordinates.
# Assign WGS84 (EPSG 4326) coordinate reference system.
pts <- SpatialPoints(coords = data.frame(x = c(106.6874498, 106.6883199),
y = c(-6.2107887, -6.2069667)),
proj4string = CRS("+init=epsg:4326"))
# Transform SpatialPoints to EPSG 5330.
pts_epsg5330 <- spTransform(x = pts, CRSobj = CRS("+init=epsg:5330"))
结果:
# Get coordinates of new SpatialPoints.
> coordinates(pts_epsg5330)
x y
[1,] 3532231 213991.4
[2,] 3532328 214415.3
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.