Overview
The.demo_landscape() function is an internal utility that creates synthetic raster time series with random pixel values. This is useful for testing, demonstrations, and learning how to use OpenLand without real data.
This is primarily an internal function for package development and testing. For production analysis, use real raster data with
contingencyTable().Function Signature
Parameters
A vector of years for the time series (e.g.,
2000:2005). First and last years are included.Number of rows in the generated raster.
Number of columns in the generated raster.
Spatial resolution of the raster cells.
Minimum x coordinate (left edge).
Maximum x coordinate (right edge).
Minimum y coordinate (bottom edge).
Maximum y coordinate (top edge).
Coordinate reference system. Use proj4 string format or NA for no projection.
Vector of land use category values to randomly assign to pixels.
Probability weights for each category. If
NULL, all categories have equal probability.Return Value
Returns a named list ofRasterLayer objects, one for each year. Each raster:
- Has dimensions
nrows×ncols - Contains pixel values randomly sampled from
category - Is named following the convention
landscape_{year} - Can be used directly with
contingencyTable()
Usage Examples
Basic Demo Landscape
Create a simple 5-year landscape with default settings:Custom Extent and Projection
Create a landscape with UTM projection:Custom Categories and Probabilities
Create a landscape dominated by forest with some agriculture:Using with OpenLand Workflow
Create demo data and run a complete analysis:Use Cases
Testing and Development
Learning and Tutorials
Benchmark Testing
Important Notes
Since this is an internal function (prefixed with
.), its interface may change in future package versions. For stable workflows, use contingencyTable() with real raster data.See Also
- contingencyTable - Process real raster time series
- Data Preparation Guide - Prepare real raster data
- Raster Input Guide - Load and validate raster files