I have two sf objects coming from different sources but supposed to represent the same polygon. However, when plotting them, they clearly appear shifted from one another:
Reprojecting the objects does not seem to solve the problem, and I am wondering whether this is due to one of the object having an "unknown datum based on 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)",
ELLIPSOID["GRS 1980",6378137,298.257222101,
LENGTHUNIT["metre",1]]], [...]
If so, is there any way to identify the datum and make sure that the polygons properly line up?
Reprex with sf objects:
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, fill = "red", alpha = .5) +
geom_sf(data = sf2, fill = "blue", alpha = .5)