jos
2013-Sep-20 23:57 UTC
[R] raster package: OpenStreetMap broken on Ubuntu, works on Mac
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
Prof Brian Ripley
2013-Sep-21 06:32 UTC
[R] raster package: OpenStreetMap broken on Ubuntu, works on Mac
What did the OpenStreetMap maintainer say (see the posting guide)? Hint: he and the raster maintainer are aware of their problem, and a correction is way overdue. The issue is not Ubuntu vs Mac but the order in which packages are installed (and for binary packages that is when they were installed to be packaged). On 21/09/2013 00:57, jos wrote:> 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-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595