Who's onlineThere are currently 0 users and 2 guests online.
User loginBook navigationNavigationLive Traffic MapNew Publications
|
SAGA GIS Binary Grid (.sdat) driver now available for GDALRoger Bivand (with the help of Volker Wichmann, Frank Warmerdam and Johan Van de Wauw) have just released the new development version of the rgdal package which now includes SAGA GIS Binary Grid (.sdat) driver. To install the packages use (the development version will soon be put on CRAN):
> download.file("http://spatial.nhh.no/R/Devel/rgdal_0.6-23.zip", destfile=paste(getwd(), "rgdal_0.6-23.zip", sep="/"))
trying URL 'http://spatial.nhh.no/R/Devel/rgdal_0.6-23.zip'
Content type 'application/zip' length 7958270 bytes (7.6 Mb)
opened URL
downloaded 7.6 Mb
> install.packages("rgdal_0.6-23.zip", repos = NULL)
package 'rgdal' successfully unpacked and MD5 sums checked
updating HTML package descriptions
then load the library in your R session: > library(rgdal) Geospatial Data Abstraction Library extensions to R successfully loaded Loaded GDAL runtime: GDAL 1.7.0dev, released 2008/11/26 Path to GDAL shared files: C:/PROGRA~2/R/R-29~1.2/library/rgdal/gdal Loaded PROJ.4 runtime: Rel. 4.6.1, 21 August 2008 Path to PROJ.4 shared files: C:/PROGRA~2/R/R-29~1.2/library/rgdal/proj Warning message: package 'rgdal' was built under R version 2.10.0 The short driver name is: > getGDALDriverNames()[71,] name long_name create copy 71 SAGA SAGA GIS Binary Grid (.sdat) TRUE TRUE To write to SAGA grid, use: # Load the data: > data(meuse.grid) > coordinates(meuse.grid) <- ~x+y > gridded(meuse.grid) <- TRUE > fullgrid(meuse.grid) <- TRUE > writeGDAL(meuse.grid["dist"], "meuse_dist.sdat", drivername="SAGA") which will create two files: (1) the header file (*.sgrd) and (2) the binary file (*.sdat). To check that everything is ok, run:
> file.show("meuse_dist.sgrd")
NAME = meuse_dist
DESCRIPTION =
UNIT =
DATAFILE_OFFSET = 0
DATAFORMAT = FLOAT
BYTEORDER_BIG = FALSE
POSITION_XMIN = 178460.0000000000
POSITION_YMIN = 329620.0000000000
CELLCOUNT_X = 78
CELLCOUNT_Y = 104
CELLSIZE = 40.0000000000
Z_FACTOR = 1.000000
NODATA_VALUE = -1.000000
TOPTOBOTTOM = FALSE
To read SAGA grids to R, use:
> meuse.sgrd <- readGDAL("meuse_dist.sdat")
meuse_dist.sdat has GDAL driver SAGA
and has 104 rows and 78 columns
|
Testimonials"Few days ago I have received copies of my book from Lulu.com. The prints are really impressive! If I think about it - Lulu never gave me any physical training about how to make a book cover, how to optimize the cost/readability balance etc; I only followed instructions on their website and submitted the document myself; and now I am looking at prints which are exactly what I would expect from a professional publisher." Poll |
Recent comments
1 year 2 weeks ago
1 year 20 weeks ago
1 year 28 weeks ago
1 year 41 weeks ago