我正在尝试更改或分配德国形状文件的投影NA
to +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
,但不知何故效果不佳。
可重现的示例:
可以下载Shapefile和其他文件here https://www.dropbox.com/s/oqofou8dc03udh9/shapefile.zip?dl=0:
我尝试的是以下内容:
library(maptools)
library(sp)
library(rgeos)
library(rgdal)
projection.x <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0")
mapG <- readShapePoly("vg2500_lan.shp", verbose=TRUE, proj4string=projection.x)
summary(mapG)
mapG <- spTransform(mapG, CRS("+proj=longlat +ellps=WGS84 +datum=WGS84"))
所以,问题是我无法在地图上绘制我的观察结果。见下文
The ponits were detected using geocode
function from ggmap
package.
Any idea how to change the projection of the shapefile or the projection of the google coordinates would be highly appreciated!
我发现了我的错误。解决方案是:
mapG <- readOGR("vg2500_lan.shp", layer="vg2500_lan")
summary(mapG)
germG <- spTransform(mapG, CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"))
plot(germG, axes=T)
And the desired output:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)