[AniMov] New problem with RGDAL

Michael Sumner mdsumner at utas.edu.au
Thu May 22 14:42:01 CEST 2008


Your example works for me if I do not set the missing value flag from R.

writeGDAL(res, "c:/temp/image1", drivername = "GTiff", type = "Float32")

I've had problems with this before, that I've not gotten around to 
exploring. At the command line you can use gdal_translate (you must 
install GDAL/FWTools) to update the file with the missing flag:

system("gdal_translate c:/temp/image1 c:/temp/image2 -a_nodata 0")
system("gdalinfo c:/temp/image2")

To test it:
d <- readGDAL("C:/temp/image2")

HTH, this is worth reporting to the rgdal author/s, and I will try to 
get around to it.

Cheers, Mike.

feurbano at clix.pt wrote:
> i have a problem exporting  probability surfaces (UD) to geotiff.
> it always worked, but since i updated the RGDAL package yesterday, it works no more ( itried many different UDs).
>
> here you have the code.
>
> library(adehabitat)
> library(sp)
> library(rgdal)
>
> data(puechabon)
> loc <- puechabon$locs[, c("X", "Y")]
> id <- puechabon$locs[, "Name"]
> ud <- kernelUD(loc, id)
> asc<-ud[[1]][[1]]
> image(asc)
> res <- asc2spixdf(asc)
> image(res)
> writeGDAL(res, "c:/temp/image1", drivername = "GTiff", type = "Float32", mvFlag = 0)
>
>
> here the error:
>
> Errore in create2GDAL(dataset = dataset, drivername = drivername, type = type,  : 
>   
>         GDAL Error 5: GDALDataset::GetRasterBand(553648270) - Illegal band #
>
> i think this is quite an important issue. where is the error? in RGDAL or in ADEHABITAT?
> Any suggestion?
>
> Ferdinando
>
>  
> ---- 
> _______________________________________________
> AniMov mailing list
> AniMov at faunalia.com
> http://www.faunalia.com/cgi-bin/mailman/listinfo/animov
>
>
>
>   




More information about the AniMov mailing list