[Raster-commits] r329 - pkg/raster/man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Mar 8 16:23:21 CET 2009
Author: rhijmans
Date: 2009-03-08 16:23:21 +0100 (Sun, 08 Mar 2009)
New Revision: 329
Modified:
pkg/raster/man/adjacency.Rd
pkg/raster/man/export.Rd
pkg/raster/man/read.Rd
Log:
Modified: pkg/raster/man/adjacency.Rd
===================================================================
--- pkg/raster/man/adjacency.Rd 2009-03-08 15:13:09 UTC (rev 328)
+++ pkg/raster/man/adjacency.Rd 2009-03-08 15:23:21 UTC (rev 329)
@@ -1,10 +1,13 @@
\name{adjacency}
+
\alias{adjacency}
\title{adjacency}
+
\description{
Identify cells that are adjacent to a set of cells on a grid
}
+
\usage{
adjacency(raster, fromCells, toCells, directions)
}
@@ -20,24 +23,26 @@
Cell numbers start with 1 in the upperleft corner and increase from left to right and from top to bottom.
Number of directions: 4 connects cells with one-cell rook moves, 8 with one-cell queen moves, and 16 with knight and one-cell queen moves.
Bishop connects cells with one-cell diagonal moves (special cases).
-The function connects the outer meridians if the raster is in a geographic (latlon) projection and longitudes between -180 and 180 degrees are covered.
+The function connects the outer meridians if the raster is not projeced (in a geographic (lat/lon) "projection") and there is
+data at longitudes -180 and 180 degrees.
}
\value{
a two column matrix with each row containing a pair of adjacent cells.
}
+
\author{Jacob van Etten \email{jacobvanetten at yahoo.com}}
\examples{
-rs <- raster(nrows=10, ncols=10)
-adj <- adjacency(raster = rs, fromCells = c(1,30,55,72,100), toCells = c(1:ncell(rs)), directions=4)
+r <- raster(nrows=10, ncols=10)
+adj <- adjacency(raster=r, fromCells = c(1,30,55,72,100), toCells = c(1:ncell(r)), directions=4)
#put the result in a RasterLayer
-v <- vector(length=ncell(rs))
+v <- vector(length=ncell(r))
v[c(1,30,55,72,100)] <- 1
v[adj[,2]] <- 2
-rs <- setValues(rs, v)
-plot(rs)
+r <- setValues(r, v)
+#plot(r)
}
Modified: pkg/raster/man/export.Rd
===================================================================
--- pkg/raster/man/export.Rd 2009-03-08 15:13:09 UTC (rev 328)
+++ pkg/raster/man/export.Rd 2009-03-08 15:23:21 UTC (rev 329)
@@ -1,12 +1,14 @@
-\name{header files}
+\name{headerFiles}
\alias{writeHeader}
\alias{worldFile}
-\title{ Write raster data to a file }
+\title{Header files}
+
\description{
- Or create header files associated with other formats for use in different software (use ENVI or ErdasRaw for ArcGIS).
+Write header files to use together with raster binary files in different software.
}
+
\usage{
writeHeader(raster, type)
worldFile(raster, extension=".wld")
@@ -19,21 +21,25 @@
}
\details{
- You can use writeRaster to save a existing file in another format. But if you have a file in a 'raster' format (or similar), you can also only export a header file, and use the data file that already exists.
- writeHeader writes an ENVI, or BIL header (.hdr) file; or an Erdas Raw (.raw) header file. This (hopefully) allows for reading the binary data ("raster.gri") in other programs such as ENVI ArcMap.
- if format = "worldfile", the function writes an ESRI "world" file, that is sometimes used to georeference images.
+You can use saveAs to save a existing file in another format. But if you have a file in a 'raster' format (or similar),
+you can also only export a header file, and use the data file that already exists.\
+writeHeader writes an ENVI, or BIL header (.hdr) file; or an Erdas Raw (.raw) header file. This (hopefully) allows for
+reading the binary data ("raster.gri") in other programs such as ENVI or ArcMap.
+
+A "worldfile", is an ESRI "world" file, that is sometimes used to georeference images.
}
\author{Robert J. Hijmans}
-\seealso{ \code{\link[rgdal]{writeGDAL}} }
+\seealso{ \code{\link[raster]{saveAs}}, \code{\link[raster]{writeRaster}}, \code{\link[rgdal]{writeGDAL}} }
+
\examples{
-rs <- rasterFromFile(system.file("external/test.ag", package="sp"))
-rs <- readAll(rs)
-rs <- setFilename(rs, 'export.grd')
-rs <- writeRaster(rs)
-writeHeader(rs, type="ENVI")
+r <- rasterFromFile(system.file("external/test.ag", package="sp"))
+r <- readAll(r)
+r <- setFilename(r, 'export.grd')
+r <- writeRaster(r)
+writeHeader(r, type="ENVI")
}
Modified: pkg/raster/man/read.Rd
===================================================================
--- pkg/raster/man/read.Rd 2009-03-08 15:13:09 UTC (rev 328)
+++ pkg/raster/man/read.Rd 2009-03-08 15:23:21 UTC (rev 329)
@@ -17,8 +17,12 @@
\title{Read values from disk}
-\description{Read values from a raster file associated with a RasterLayer or RasterStack object into memory.
-You can either read all the data (memory permitting), or read data by row, part of row, block, by cellnumber, or for (x,y) coordinates. Data can be read from 'native raster' binary files, as well as for other formats that are supported by the rgdal package.
+
+\description{
+Read values from a raster file associated with a RasterLayer or RasterStack object into memory.
+You can either read all the data (memory permitting), or read data by row, part of row, block, by cellnumber,
+or for (x,y) coordinates. Data can be read from 'native raster' binary files, as well as for other formats
+that are supported by the rgdal package.
}
@@ -42,6 +46,8 @@
\note{After read* the values are accessible with the "values(object)" function}
+\seealso{ \code{\link[raster]{writeRaster}}, \code{\link[raster]{xyValues}} }
+
\author{Robert J. Hijmans}
\examples{
More information about the Raster-commits
mailing list