st_transform does not transform map projection correcttly in some situations · Issue #1983 · r-spatial/sf (original) (raw)
Describe the bug
st_transform does not transform map projection correcttly in some situations.
To Reproduce
library(sf)
library(ggplot2)
library(rnaturalearth)
wld <- ne_coastline(returnclass = "sf")
wld2 <- st_transform(wld, crs = "+proj=natearth")
ggplot() +
geom_sf(data = wld2)
When I use the function of st_transform in sf package to transform map projection from "wgs1984" to "Natural Earth"(https://proj.org/operations/projections/natearth.html), the horizontal line appear on the the high latitudes of the northern hemisphere. The figure shown as follow.
library(sf)
library(ggplot2)
library(rnaturalearth)
wld <- ne_countries(returnclass = "sf")
wld2 <- st_transform(wld, crs = "+proj=natearth +lon_0=110")
ggplot() +
geom_sf(data = wld2) +
theme_bw()
When I transform the Longitude of projection center, I'm getting more inexplicable errors. The figure shown as follow.
Why is that?