问题描述
我有两个来自不同来源的sf对象,但应该代表相同的多边形。但是,在绘制它们时,它们显然彼此偏移:
重新投影对象似乎无法解决问题,我想知道这是否是由于其中一个对象具有“基于GRS 1980的未知数据”引起的。
st_crs(sf1)
Coordinate Reference System:
User input: NAD83
wkt:
GEOGCRS["NAD83",DATUM["north American Datum 1983",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],[...]
st_crs(sf2)
Coordinate Reference System:
User input: UnkNown datum based upon the GRS 1980 ellipsoid
wkt:
GEOGCRS["UnkNown datum based upon the GRS 1980 ellipsoid",DATUM["Not specified (based on GRS 1980 ellipsoid)",[...]
如果是,是否有任何方法可以识别基准面并确保多边形正确对齐?
用sf对象代替:
download.file(destfile = "sf1.rds","https://github.com/JoakimWeill/projection_issue_reprex/raw/master/sf1.rds")
download.file(destfile = "sf2.rds","https://github.com/JoakimWeill/projection_issue_reprex/raw/master/sf2.rds")
sf1 <- readRDS("sf1.rds")
sf2 <- readRDS("sf2.rds")
ggplot() +
geom_sf(data = sf1,fill = "red",alpha = .5) +
geom_sf(data = sf2,fill = "blue",alpha = .5)
sf1 <- st_transform(sf1,st_crs(sf2))
ggplot() +
geom_sf(data = sf1,alpha = .5)
解决方法
也许您需要定义投影而不是转换投影。例如,尝试将未知数的基准定义为NAD83,然后查看它们是否对齐。如果不是,请尝试将其定义为NAD27,转换为NAD83,然后查看其是否有效。您需要先告诉它正确的起点,然后才能将其转换为其他内容。我的猜测是NAD83或NAD27而不是WGS84,这是因为椭球以及它如何移动。 https://www.esri.com/arcgis-blog/products/arcgis-desktop/mapping/wgs84-vs-nad83/