r - Error when importing raster file -


i transformed shapefile raster file using rasterize r function, , saved raster writeraster function (.bil , .asc). now, can't import new file, returning error:

error in .local(.object, ...) :    ehdr driver not support 64 nbits value.  erro em .rasterobjectfromfile(x, band = band, objecttype = "rasterlayer",  :    cannot create rasterlayer object file. 

my script:

library(maptools) library(raster) # shapefile natural earth website  <- readshapespatial('ne_10m_roads.shp')  e <- extent( -180, 180, -60, 90 )  r <- raster(e, nrow=3600, ncol=8640)  s2r <- rasterize(a,r) 

i have using notebook ubuntu 14.10 - 64bit, , 4gb ram, rstudio software , r version 3.1.1:

r version 3.1.1 (2014-07-10)  copyright (c) 2014 r foundation statistical computing platform: x86_64-pc-linux-gnu (64-bit) 

*after format computer, new file correctly open before install dependences of rgdal via terminal.

** directories correctly choosen, , file found directory.

why use these formats? bil obsolete, ascii inefficient. better use geotiff or (if working within realm of r/raster) grd (the default format).

i suppose error occurs 'bil' file, not ascii file. when writing 'bil' file may want specify writeraster argument datatype='int2s', datatype='flt4s' or other datatype not 64 bits ('flt8s'). not need have precision (unless want store large integer numbers exactly). may able read file with:

raster('file.bil', native=true) 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -