[R-sig-Geo] issue with daily rainfall in .bil format

Kapo Coulibaly kmcoulib at gmail.com
Mon Sep 12 20:13:11 CEST 2016


Hi Abdoulaye,
Did you try the NAflag argument in writeRaster. It allows you to overwrite
the default value used to represent NA in a file.
Cheers.

On Fri, Sep 9, 2016 at 5:46 AM, Abdoulaye Sarr <abdoulayesar at gmail.com>
wrote:

> I have daily rainfall data in .bil format and can get info of the file
> using rgdal:
> > library(rgdal)> GDALinfo("/1981/v2p19810101.bil")
> rows        1600
> columns     1500
> bands       1
> lower left origin.x        -20
> lower left origin.y        -40
> res.x       0.05
> res.y       0.05
> ysign       -1
> oblique.x   0
> oblique.y   0
> driver      EHdr
> projection  NA
>
> library(raster)
> pp <- raster("/1981/v2p19810101.bil")
> writeRaster(pp, "v2p19810101.nc")
>
> The problem is that when I display the netcdf file the values are starting
> by -9000 and mainly are located in the continent boundaries, so how to add
> in writeRaster the undef values and have precip from 0 to x.
>
> Any hint appreciated.
>
>         [[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
>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list