从地理WGS84到Mercator的R点项目-非有限

从地理WGS84到Mercator的R点项目-非有限,r,gis,map-projections,R,Gis,Map Projections,我在R中遇到了一些我不理解的投影问题 我已下载以下全局数据集: 然后,我使用不同的投影创建地图,以教授空间投影的概念 library(raster) library(rgdal) worldBoundClipped <- crop(worldBound,extent(-180,180,-84,80)) worldBound_merc <- spTransform(worldBoundClipped,CRS("+init=epsg:3395")) 我已成功映射和重新投影/映射lat

我在R中遇到了一些我不理解的投影问题

我已下载以下全局数据集:

然后,我使用不同的投影创建地图,以教授空间投影的概念

library(raster)
library(rgdal)
worldBoundClipped <- crop(worldBound,extent(-180,180,-84,80))
worldBound_merc <- spTransform(worldBoundClipped,CRS("+init=epsg:3395"))
我已成功映射和重新投影/映射lat/lon WGS84中的数据,并重新投影到Robinson

library(rgdal)
library(ggplot2)
setwd("~/Documents/data")

# read shapefile
worldBound <- readOGR(dsn="Global/Boundaries/ne_110m_land", 
                layer="ne_110m_land")

# convert to dataframe
worldBound_df <- fortify(worldBound)  

# plot map
ggplot(worldBound_df, aes(long,lat, group=group)) +
  geom_polygon() +
  labs(title="World map (longlat)") +
  coord_equal() +
  ggtitle("Geographic - WGS84 Datum")

# reproject from longlat to robinson
worldBound_robin <- spTransform(worldBound,
                          CRS("+proj=robin"))
worldBound_df_robin <- fortify(wmap_robin)
ggplot(worldBound_df_robin, aes(long,lat, group=group)) +
  geom_polygon() +
  labs(title="World map (robinson)") +
  coord_equal()
库(rgdal)
图书馆(GG2)
setwd(“~/Documents/data”)
#读取形状文件

世界范围问题似乎是位于epsg:3395投影范围之外的点(-180,-80,180,84)。要更正此问题,可以将shapefile剪裁到适当的范围,然后执行重投影

library(raster)
library(rgdal)
worldBoundClipped <- crop(worldBound,extent(-180,180,-84,80))
worldBound_merc <- spTransform(worldBoundClipped,CRS("+init=epsg:3395"))
库(光栅)
图书馆(rgdal)

worldBoundClipped您的数据集在北极和南极有点/顶点吗?这些点不是在墨卡托投影中定义的,可能是无限的。确实如此!天哪,我没想到要检查墨卡托的狭长边界。好的,我将把它们调整到南北82度的范围内,然后再次尝试投影!非常感谢。这是有道理的,而且很可能是罪魁祸首。是否有一个有效的方法来将空间数据帧中的所有坐标缩放到大于82等于82?我正试图想出一种创造性的方法来解决这个问题。对我来说,如果温度超过82度,将温度点移动到82度是没有意义的。物理上的理由是什么?非常正确。我只是觉得为这次演示裁剪数据更有意义。非常感谢。
library(raster)
library(rgdal)
worldBoundClipped <- crop(worldBound,extent(-180,180,-84,80))
worldBound_merc <- spTransform(worldBoundClipped,CRS("+init=epsg:3395"))