[R-sig-Geo] basic question about plotKML

Struve,Juliane jstruve at ufl.edu
Sat Sep 29 02:11:36 CEST 2012


Hello,


That did it, thank you !

Roman, it sound like you ran the script without adding this argument, how does this work ?

Regards,

Juliane 

-----Original Message-----
From: Edzer Pebesma [mailto:edzer.pebesma at uni-muenster.de] 
Sent: Friday, September 28, 2012 11:36 AM
To: Struve,Juliane
Cc: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] basic question about plotKML

try adding kmz = FALSE as argument to your plotKML call.

On 09/28/2012 03:41 PM, Struve,Juliane wrote:
> Hello,
> 
> Thank you very much for replying so quickly.
> 
> plotKML(SP.spdf) gives me an error message:
> Plotting the first variable on the list
> KML file header opened for parsing...
> Parsing to KML...
> Closing  SP.spdf.kml
> Error in kml_compress(file.name = file.name) : 
> KMZ generation failed. Wrong command passed to 'zip = ... option'.
> 
> sessionInfo()
> R version 2.15.0 (2012-03-30)
> Platform: i386-pc-mingw32/i386 (32-bit)
> 
> locale:
> [1] LC_COLLATE=English_United States.1252 
> [2] LC_CTYPE=English_United States.1252   
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C                          
> [5] LC_TIME=English_United States.1252    
> 
> attached base packages:
> [1] splines   stats     graphics  grDevices utils     datasets  methods  
> [8] base     
> 
> other attached packages:
>  [1] RSAGA_0.93-1       shapefiles_0.6     animation_2.1      plotKML_0.2-5     
>  [5] dismo_0.7-23       scales_0.2.2       aqp_1.2-7          gstat_1.0-14      
>  [9] spacetime_0.8-0    xts_0.8-6          zoo_1.7-7          Hmisc_3.9-3       
> [13] survival_2.36-12   RColorBrewer_1.0-5 stringr_0.6.1      colorRamps_2.3    
> [17] plotrix_3.4-5      colorspace_1.1-1   plyr_1.7.1         raster_2.0-12     
> [21] pixmap_0.4-11      XML_3.9-4.1        rgdal_0.7-19       maptools_0.8-16   
> [25] lattice_0.20-6     foreign_0.8-49     sp_0.9-99         
> 
> loaded via a namespace (and not attached):
> [1] cluster_1.14.2  dichromat_1.2-4 grid_2.15.0     labeling_0.1   
> [5] munsell_0.4     reshape_0.8.4   tools_2.15.0   
> 
> How can I get plotKML() to work on my example data ?
> 
> Best wishes,
> 
> Juliane 
> 
> 
> -----Original Message-----
> From: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of Edzer Pebesma
> Sent: Friday, September 28, 2012 5:22 AM
> To: r-sig-geo at r-project.org
> Subject: Re: [R-sig-Geo] basic question about plotKML
> 
> For me this works too -- cold region. Did you update packages and R to
> newest versions? Sending the output of sessionInfo() usually helps, when
> asking help from the list.
> 
> On 09/28/2012 10:30 AM, Roman Luštrik wrote:
>> Your code works for me?
>>
>> http://tinypic.com/r/iblw5w/6
>>
>> Cheers,
>> Roman
>>
>>
>>
>> On Fri, Sep 28, 2012 at 5:43 AM, Struve,Juliane <jstruve at ufl.edu> wrote:
>>>
>>> Dear list,
>>>
>>> I am trying to plot some spatial data in Google Earth but have a hard time with the plotKML manual. What is missing in my script that will make plotKML() work ?
>>>
>>> Thank you for your time,
>>>
>>> Juliane
>>>
>>> xc = round(runif(10,-1,1)+27.2, 2)
>>> yc = round(runif(10,-1,1)+-82.5, 2)
>>> xy = cbind(xc, yc)
>>> xy.sp = SpatialPoints(xy)
>>> df = data.frame(z1 = round(5 + rnorm(10), 2), z2 = 20:29)
>>> SP.spdf = SpatialPointsDataFrame(xy.sp, df)
>>> plot(SP.spdf)
>>> #add a projection
>>> proj4string(SP.spdf) = CRS("+proj=longlat +datum=WGS84")
>>> plotKML(SP.spdf)
>>>
>>>         [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo at r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>>
>>
>>
>> --
>> In God we trust, all others bring data.
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
> 

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma at wwu.de



More information about the R-sig-Geo mailing list