[R-sig-Geo] raster package, values pixel order

Oliver Soong osoong+r at gmail.com
Wed Feb 8 02:14:51 CET 2012

Ah, thanks for pointing out the definition of cell order.  The
documentation for raster::values doesn't specify that
values(rasterLayer, format = "") always returns values in cell order,
nor does it state that values(rasterStack) or values (rasterBrick)
returns rows in cell order, so I wanted to check.


On Tue, Feb 7, 2012 at 3:57 PM, Roman Luštrik <roman.lustrik at gmail.com> wrote:
> From the package vignette (try vignette("Raster")):
> The cell number is an important concept in the raster package. Raster data
> can be thought of as a matrix, but in a RasterLayer it is more commonly
> 19
> treated as a vector. Cells are numbered from the upper left cell to the
> upper
> right cell and then continuing on the left side of the next row, and so on
> until the
> last cell at the lower-right side of the raster.
> There are several helper functions
> to determine the column or row number from a cell and vice versa, and to
> determine the cell number for x, y coordinates and vice versa.
> Cheers,
> Roman
> On Wed, Feb 8, 2012 at 12:12 AM, Oliver Soong <osoong+r at gmail.com> wrote:
>> Can somebody confirm whether raster::values(x, format = "") always
>> starts in the top-left of the image and moves left-to-right then
>> top-to-bottom?
>> I'm really hoping it doesn't depend on the pixel order of the underlying
>> raster.
>> Thanks,
>> Oliver
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> --
> In God we trust, all others bring data.

More information about the R-sig-Geo mailing list