[R] raster package: OpenStreetMap broken on Ubuntu, works on Mac
jos
joseph8472 at yahoo.com
Sat Sep 21 01:57:20 CEST 2013
Hi,
I'm a novice in R and I was trying to play with OpenStreetMap package as in a few examples on the web. And the examples worked on my Mac but on Ubuntu (12.04) they fail to work. The simplest one is:
library(OpenStreetMap)
library(rgdal)
map <- openmap(c(70,-179), c(-70,179))
plot(map)
(OpenStreetMap, rgdal, rJava etc..) packages have to be installed first.
On the Mac - it worked without any problems from the first try (shows a picture of world map). On Ubuntu, I get:
'merge' is not an exported object from 'namespace:raster'
when I execute the "openmap" function.
Now, at first I thought that the problem was in different library versions and it was quite a pain to make ubuntu install everything I wanted (rgdal being the biggest - unless one knows exactly what to look for on the internet, instructions are vague and there is a lot of outdated versions out there). But even after that, when version numbers matched on both OSes in R console, it still failed to work on Ubuntu. So the versions are:
library(rgdal)
Loading required package: sp
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: /usr/local/share/gdal
Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]
Path to PROJ.4 shared files: (autodetected)
Still didn't work with identical output on both machines. Then I thought that the problem must be in "raster" library, but both have the same version number:
packageVersion("raster")
[1] ‘2.1.49’
but after showing all the functions in "raster" package, although both have 235 elements:
basevals <- ls(pos="package:raster")
basevals
the Mac one has "merge" listed and Ubuntu - doesn't. Also on Mac, the array begins with "%in%" and on Ubuntu with "addLayer"... so there is more than one inconsistency and "merge" is actually breaking openmap().
My questions are:
*is this a bug?
*is there a workaround (eg. can I "export" merge from raster namespace myself by copying potentially the code from Mac)?
Thanks in advance,
J
More information about the R-help
mailing list