[R-sig-Geo] plotKML 'kml' function with raster input

Paul Woods p.woods at qub.ac.uk
Tue Oct 13 00:30:57 CEST 2015


Try changing your forward slashes (/) to backward slashes (\) as per Windows standard?

Paul

> On 12 Oct 2015, at 23:26, Gregovich, Dave P (DFG) <dave.gregovich at alaska.gov> wrote:
> 
> Hello,
> I am not able to create a .kml raster via the 'kml' function of plotKML (see the error below).
> I am  setting the path to gdal in my windows registry as  'C:/Program Files/GDAL' -- the folder that contains 'gdalwarp.exe' and 'gdal_translate.exe' upon gdal installation.
> I have also set the parameters in 'plotKML.env' in the two following ways (I don't know which it is supposed to be).
> plotKML.env(gdalwarp = 'C:/Program Files/GDAL', gdal_translate = 'C:/Program Files/GDAL')
> and
> plotKML.env(gdalwarp = 'C:/Program Files/GDAL/gdalwarp.exe', gdal_translate = 'C:/Program Files/GDAL/gdal_translate.exe')
> 
> 
> kml.folder <- 'c:/dave/temp';kml.file <- 'test.kml'
> rast <- raster(extent(-135.2,-135.1,58.1,58.2),nrows=10,ncol=10,crs=CRS('+init=epsg:4326'))
> rast[]<-rnorm(ncell(rast))
> kml(rast,kml.fold,kml.file,colour = 'black')
> 
> #Results in the following messages...with no kml or kmz file output.
> KML file opened for writing...
> Writing to KML...
> Closing  test.kml
> Warning message:
> In paths(show.paths = TRUE) :
>  Could not locate GDAL! Install program and add it to the Windows registry. See http://www.gdal.org/ for more info.
> 
>> sessionInfo()
> R version 3.1.3 (2015-03-09)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 7 x64 (build 7601) Service Pack 1
> 
> other attached packages:
> [1] plotKML_0.5-3 rgdal_1.0-7   raster_2.4-20 sp_1.2-0
> 
> ++++++++++++++++++++++++++++++++
> Thanks kindly for your continued support.
> 
> __________________________________
> Dave Gregovich
> Research Analyst
> Alaska Department of Fish and Game
> Wildlife Conservation Division
> Douglas, AK 99821
> (907) 465-4291
> dave.gregovich at alaska.gov
> __________________________________
> 
> 
> 	[[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



More information about the R-sig-Geo mailing list