[R-sig-Geo] Problem when export raster to KML

Richard Ma xuanlong.ma at uts.edu.au
Thu Feb 2 02:03:10 CET 2012


Hi all,

Below is the information of my raster file:

> r.tmp
class       : RasterLayer 
dimensions  : 220, 200, 44000  (nrow, ncol, ncell)
resolution  : 0.05, 0.05  (x, y)
extent      : 128, 138, -23, -12  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=lonlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 
values      : in memory
min value   : 5.079816e-05 
max value   : 0.9999755 

however, when I want to use KML function (raster package) to export this
raster to KML, I got an error.

> KML(r.tmp, file = 'r_tmp.kml')
Error in .local(x, ...) : CRS of x must be longitude / latitude

Does this means I need to reproject my raster file to longitude/latitude
coordinates system? How to do that?


-----
Richard Ma
PhD student, Ecology & Remote Sensing
Climate Change Cluster, Department of Environment Science
University of Technology, Sydney
http://everydropr.wordpress.com
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Problem-when-export-raster-to-KML-tp7245302p7245302.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list