Skip to content
Prev 20103 / 29559 Next

problems with plotting STFDF

Hi Erin,

In the spacetime package there should be a function that allows you to 
coerce from STFDF to STIDF class e.g. "as.STIDF.STFDF" 
(https://r-forge.r-project.org/scm/viewvc.php/pkg/R/coerce.R?view=markup&root=spacetime 
<https://r-forge.r-project.org/scm/viewvc.php/pkg/R/coerce.R?view=markup&root=spacetime&pathrev=25>). 
Once your object is of STIDF class, then you can use "kml" function e.g. 
in a loop:

x <- as.STIDF.STFDF(x)
kml_open("x.kml")
kml_layer(x, colour="var1.pred")
kml_close("x.kml")

I might add plotting support for STFDF objects in the future. At the 
moment I do not see a special reason for this because STFDF is basically 
a 'compressed' / special case of STIDF, which hence needs to be 
'decompressed' anyway before you can write it to KML (classes in the 
spacetime package are hence more creative than in the KML, but then the 
beauty of KML is that it is rather simple while the compression is 
implemented usually through zipping / KMZ).

HTH

T. Hengl
https://www.vcard.wur.nl/Views/Profile/View.aspx?id=37263
On 29-12-2013 16:55, Edzer Pebesma wrote: