Learn R Programming

sperich (version 1.3-7)

exportAsGDAL: Export result grid as GDAL grid map

Description

This function exports the result grid as a GDAL grid map.

Usage

exportAsGDAL(grid, shift, resolution, directory=getwd(), filename="grid.tif", drivername="GTiff")

Arguments

grid
The grid that should be exported.
shift
The geographic coordinates of the origin of the grid.
resolution
The resolution of the grid in (geographical) degree.
directory
The directory in which the file will be created.
filename
The name of the created file containing the GDAL grid map.
drivername
Determines the format of the resulting GDAL grid map. All available drivers can be shown by using the command 'gdalDrivers()'.

Details

This routine exports a grid as an GDAL grip map. The package rgdal is required.

Examples

Run this code
##load data
data(dataset.all.species)
data(dataset.landwater)

##create grid parameters
dimension <- getDimension(dataset.all.species, resolution=1)
shift <- getShift(dataset.all.species)

##create landwatermask
landwatermask.nocoast <- createLandwatermask(dataset.landwater, 
						dimension, shift, resolution=1)

##estimate species richness
species.richness.weighted <- species.richness(dataset.all.species,
landwatermask.nocoast, distances=1:10, weight=0.5, dimension,
shift, resolution=1, upperbound=3000, all.species=1:20)

##export
exportAsGDAL(species.richness.weighted, shift, resolution=1, 
	    directory=getwd(), filename="species.richness.tif", drivername="GTiff")

Run the code above in your browser using DataLab