问题描述
有人可以帮助解释为什么我将边界框投影到新的CRS中,然后使用结果范围(xmin
,ymin
,xmax
,ymax
)重新生成边界框,然后重新投影回原始CRS,结果范围(x坐标)与我开始的有所不同?我觉得我缺少一些基本知识。
library(sf)
# generate a bounding Box in epsg:4326,# and then transform to Equal Earth projection
bb_ee = sf::st_bBox(c(xmin = -20,xmax = 30,ymin = 30,ymax = 65),crs = 4326) %>%
sf::st_as_sfc() %>%
sf::st_transform(crs = "+proj=eqearth +datum=wgs84 +wktext") %>%
sf::st_bBox()
# using extents from above (xmin,ymin,xmax,ymax) in Equal Earth projection
# and transform back to epsg:4326 projection
bb_4326 = sf::st_bBox(c(xmin = bb_ee[['xmin']],xmax = bb_ee[['xmax']],ymin = bb_ee[['ymin']],ymax = bb_ee[['ymax']]),crs = "+proj=eqearth +datum=wgs84 +wktext") %>%
sf::st_as_sfc() %>%
sf::st_transform(crs = 4326) %>%
sf::st_bBox()
# input is
# xmin ymin xmax ymax
# -20 30 30 65
bb_4326
# result is
# xmin ymin xmax ymax
# -26.12724 30.00000 39.19085 65.00000
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)