Book Image

Learning R for Geospatial Analysis

By : Michael Dorman
Book Image

Learning R for Geospatial Analysis

By: Michael Dorman

Overview of this book

Table of Contents (18 chapters)
Learning R for Geospatial Analysis
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
External Datasets Used in Examples
Cited References
Index

Overlay and reclassification of rasters


In this section, we will introduce two basic operations involving rasters: performing mathematical operations between overlapping rasters and reclassifying the values of a raster into new aggregated categories.

Raster algebra and overlay operations

In many cases, when we have two or more overlapping rasters, we would like to apply a certain function on each pair, triplet, and so on of overlapping pixels in those rasters. As a result, we will get a new raster, where the value of each pixel is the result of the latter function on the respective pixels in the input rasters. Such operations are also referred to as raster algebra, usually when using straightforward arithmetic notation (such as r+s, where r and s are rasters) or overlay operations.

There are numerous functions that can be used in raster algebra expressions, including arithmetic operators (such as +, -, *, and /), logical operators (such as >, >=, <, <=, ==, and !), and several simple...