首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将WGS84改为EPSG:5330 in R

将WGS84改为EPSG:5330 in R
EN

Stack Overflow用户
提问于 2018-11-13 11:02:31
回答 1查看 106关注 0票数 1

我想将坐标形式WGS84改为EPSG:5330。希望,任何人都可以帮我谢谢

代码语言:javascript
复制
ID,X,Y   
1,106.6874498,-6.2107887   
2,106.6883199,-6.2069667
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-05-30 18:26:26

sp库简单易学。

代码语言:javascript
复制
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"))

结果:

代码语言:javascript
复制
# Get coordinates of new SpatialPoints.
> coordinates(pts_epsg5330)

           x        y
[1,] 3532231 213991.4
[2,] 3532328 214415.3
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53279588

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档