Hi, I am very new to R and I am trying to write KML files. I am running R-2.13.1 and I have the following packages: - AKIMA - RGDAL - RSAGA - SP I was trying to run the simple example that I found at the following web page: http://spatial-analyst.net/wiki/index.php?title=Export_maps_to_GE The lines that I can run are: data(meuse.grid) coordinates(meuse.grid) <- ~x+y gridded(meuse.grid) <- TRUE proj4string(meuse.grid) = CRS("+init=epsg:28992") # raster to polygon conversion; writeGDAL(meuse.grid["soil"], "meuse_soil.sdat", "SAGA", mvFlag=-99999) rsaga.geoprocessor(lib="shapes_grid", module=6, param=list(GRID="meuse_soil.sgrd", POLYGONS="meuse_soil.shp", CLASS_ALL=1)) and it crashes there with the following error message: Error in setwd(env$workspace) : character argument expected In addition: Warning message: In rsaga.env() : SAGA command line program 'saga_cmd.exe' not found in any of the paths C:/Program Files/R/R-2.13.1/library/RSAGA/saga_vc C:/Program Files/R/R-2.13.1/library/RSAGA/SAGA-GIS ... Can someone please let me know what I should do to fix that error? Thanks, Mel [[alternative HTML version deleted]]
R. Michael Weylandt <michael.weylandt@gmail.com>
2012-Feb-25 01:51 UTC
[R] Producing KML files
Hi Melicie, I'm not a Windows user or a user of SAGA but the warning message suggests part of the problem may be that R can't find your SAGA installation. Is it in your Windows PATH? You may be able to get more specialized help on the R-SIG-geo list as well. Michael On Feb 24, 2012, at 12:06 PM, "Desflots, Melicie" <mdesflots at AIR-WORLDWIDE.COM> wrote:> Hi, > > I am very new to R and I am trying to write KML files. I am running R-2.13.1 and I have the following packages: > > - AKIMA > > - RGDAL > > - RSAGA > > - SP > > > I was trying to run the simple example that I found at the following web page: > http://spatial-analyst.net/wiki/index.php?title=Export_maps_to_GE > > The lines that I can run are: > > data(meuse.grid) > coordinates(meuse.grid) <- ~x+y > gridded(meuse.grid) <- TRUE > proj4string(meuse.grid) = CRS("+init=epsg:28992") > # raster to polygon conversion; > writeGDAL(meuse.grid["soil"], "meuse_soil.sdat", "SAGA", mvFlag=-99999) > rsaga.geoprocessor(lib="shapes_grid", module=6, > param=list(GRID="meuse_soil.sgrd", POLYGONS="meuse_soil.shp", CLASS_ALL=1)) > > and it crashes there with the following error message: > > Error in setwd(env$workspace) : character argument expected > In addition: Warning message: > In rsaga.env() : > SAGA command line program 'saga_cmd.exe' not found in any of the paths > C:/Program Files/R/R-2.13.1/library/RSAGA/saga_vc > C:/Program Files/R/R-2.13.1/library/RSAGA/SAGA-GIS > ... > > Can someone please let me know what I should do to fix that error? > > Thanks, > Mel > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.