[R-sig-Geo] problem with OpenStreetMap
christiaan pauw
cjpauw at gmail.com
Sun Mar 11 20:03:13 CET 2012
Hi Everbody
I read this blog about the new OpenStreetMap package
(http://www.r-bloggers.com/plot-maps-like-a-boss/), downloaded the
package and tried out the example.
The first example is:
library(OpenStreetMap)
library(rgdal)
map <- openmap(c(70,-179), c(-70,179))
plot(map)
It looked simple enough. However, this resulted in an error which
appears to be related to the fact that my R version is 2.14.0 and the
package ‘OpenStreetMap’ was built under R version 2.14.1 (see below
together with sessionInfo())
Is this correct or is it perhaps something else.
regards
Christiaan
> library(OpenStreetMap)
Loading required package: rJava
Loading required package: sp
Loading required package: maptools
Loading required package: foreign
Loading required package: lattice
Checking rgeos availability: FALSE
Note: when rgeos is not available, polygon geometry computations in
maptools depend on gpclib,
which has a restricted licence. It is disabled by default;
to enable gpclib, type gpclibPermit()
Loading required package: raster
raster version 1.9-70 (27-February-2012)
Warning messages:
1: package ‘OpenStreetMap’ was built under R version 2.14.1
2: package ‘raster’ was built under R version 2.14.1
> library(rgdal)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.8.1, released 2011/07/09
Path to GDAL shared files:
/Users/christiaanpauw/Library/R/2.14/library/rgdal/gdal
Loaded PROJ.4 runtime: Rel. 4.7.1, 23 September 2009, [PJ_VERSION: 470]
Path to PROJ.4 shared files:
/Users/christiaanpauw/Library/R/2.14/library/rgdal/proj
> map <- openmap(c(70,-179), c(-70,179))
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
java.lang.InternalError: Can't start the AWT because Java was
started on the first thread. Make sure StartOnFirstThread is not
specified in your application's Info.plist or on the command line
> plot(map)
Error in plot.window(...) : need finite 'xlim' values
In addition: Warning messages:
1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
2: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
3: In min(x) : no non-missing arguments to min; returning Inf
4: In max(x) : no non-missing arguments to max; returning -Inf
5: In min(x) : no non-missing arguments to min; returning Inf
6: In max(x) : no non-missing arguments to max; returning -Inf
Sessio Info below:
> sessionInfo()
R version 2.14.0 (2011-10-31)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_US/en_US/en_US/C/en_US/en_US
attached base packages:
[1] grid splines stats graphics grDevices utils
datasets methods base
other attached packages:
[1] rgdal_0.7-5 maps_2.2-2 OpenStreetMap_0.2
raster_1.9-70 maptools_0.8-10
[6] foreign_0.8-46 rJava_0.9-2 portfolio_0.4-5
nlme_3.1-102 Hmisc_3.9-0
[11] ggplot2_0.8.9 proto_0.3-9.2 reshape_0.8.4 plyr_1.6
reporttools_1.0.6
[16] xtable_1.6-0 doBy_4.4.3 MASS_7.3-16 snow_0.3-8
lme4_0.999375-42
[21] Matrix_1.0-1 lattice_0.20-0 multcomp_1.2-8
mvtnorm_0.9-9991 R2HTML_2.2
[26] survival_2.36-10 descr_0.4.2 TeachingDemos_2.7
prettyR_2.0-1 sp_0.9-93
loaded via a namespace (and not attached):
[1] cluster_1.14.1 digest_0.5.1 stats4_2.14.0 tools_2.14.0
--
Christiaan Pauw
Nova Institute
www.nova.org.za
More information about the R-sig-Geo
mailing list