在Windows中将OSM地图图块导入R时出错

时间:2013-11-26 11:27:19

标签: r rgdal

此代码在Macbook上运行正常,但在我的Windows桌面上失败并出现错误:

Error in raster(x) : 
      error in evaluating the argument 'x' in selecting a method for function 'raster': Error: 'merge' is not an exported object from 'namespace:raster'

任何想法是什么造成的?

完整代码:

> require(OpenStreetMap)
Loading required package: OpenStreetMap
Loading required package: rJava
Loading required package: raster
Loading required package: sp
Loading required package: rgdal
rgdal: version: 0.8-11, (SVN revision 479M)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.9.2, released 2012/10/08
Path to GDAL shared files: C:/Users/Robin/Documents/R/win-library/3.0/rgdal/gdal
GDAL does not use iconv for recoding strings.
Loaded PROJ.4 runtime: Rel. 4.7.1, 23 September 2009, [PJ_VERSION: 470]
Path to PROJ.4 shared files: C:/Users/Robin/Documents/R/win-library/3.0/rgdal/proj
> lat <- c(51.7, 51.3); lon <- c(-0.53, 0.3)
> map <- openproj(openmap(c(lat[1],lon[1]),c(lat[2],lon[2]), 8, 'osm'))
Error in raster(x) : 
  error in evaluating the argument 'x' in selecting a method for function 'raster': Error: 'merge' is not an exported object from 'namespace:raster'

1 个答案:

答案 0 :(得分:1)

它是与用于合并切片的方法相关的栅格中的错误 - 无论是升级还是使用捏合mergeTiles=FALSE