【发布时间】:2019-06-04 10:47:57
【问题描述】:
我设法将我在 EPSG:4326 中投影的坐标集转换为 EPSG:3857,但是结果与我得到的不匹配
https://epsg.io/transform#s_srs=4326&t_srs=3857&x=14.5172200&y=46.0658300 或直接在 ArcGIS 中,尽管 r 中提供的 EPSG 系统的细节(参见下面的脚本)与 GIS 软件中的描述相匹配。
我已经用下面的代码试过了:
library("rgdal", lib.loc="~/Library/R/3.4/library")
orig_coords <- data.frame(lat=c(46.065830, 46.042211, 46.094612), lon=c(14.517220, 14.487756, 14.597046))
coordinates(orig_coords) <- c('lat', 'lon')
#Determine the projection of the lat-long coordinates, by default it is EPSG:4326
proj4string(orig_coords) <- CRS("+init=epsg:4326")
print(summary(orig_coords))
#Convert the coordinates to the used metric system (EPSG:3857)
Metric_coords<-spTransform(orig_coords,CRS("+init=epsg:3857"))
print(summary(Metric_coords))
正确的坐标是
5790904.807 1616049.538;
5787116.145 1612769.621;
5795523.844 1624935.728;
相反,我得到:
lat - lon;
[1,] 5128025 1633624;
[2,] 5125395 1630236;
[3,] 5131229 1642804;
我找不到问题出在哪里...
【问题讨论】:
-
反转 'lon' 和 'lat'
标签: r coordinates geospatial arcgis rgdal