[R-sig-Geo] rsaga.import.gdal gives weird output

Ottow, Bouke Pieter boukepieter.ottow at wur.nl
Fri Nov 7 15:45:42 CET 2014


Dear list,

I am using R 3.1.2 on Ubuntu 14 with SAGA GIS 2.1.1 and RSAGA 0.93-6.
I have a SRTM derived DEM called DEM.tif which I want to use with SAGA from R.

I do:
library(raster)
library(rgdal)
library(sp)
library(RSAGA)
work_env <- rsaga.env(modules="/usr/local/lib/saga/")
rsaga.import.gdal("source/DEM.tif", env=work_env)

Now I want to check the converted file, so I do:
result <- raster("source/DEM.sdat")
plot(result)
DEM <- raster("source/DEM.tif")
plot(DEM)

The original DEM is plotted like this:
[X]
The resulting DEM is plotted like this:
[X]
How does this happen? The projection and cellsize seem lost, and it is turned upside down.
When I open the file in SAGA GIS it looks the same but it says it has the right projection (WGS 84, epsg 4326). I can also open the tif file in SAGA which seems alright.

I had this problem before with other versions too.

Kind regards,
Bouke Pieter Ottow



More information about the R-sig-Geo mailing list