我设法将我在EPSG:4326中投影的坐标集转换为EPSG:3857,但是,结果与我在
虽然r中提供的EPSG系统的细节(参见下面的脚本)与https://epsg.io/transform#s_srs=4326&t_srs=3857&x=14.5172200&y=46.0658300软件中的描述相匹配,但也可以直接在ArcGIS中找到。
我已经用以下代码尝试过了:
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;我找不到问题出在哪里。
发布于 2019-06-25 21:13:38
我相信CRS("+init=epsg:3857")必须由大写的CRS("+init=EPSG:3857")
https://stackoverflow.com/questions/54113896
复制相似问题