Overview
Before analyzing land use and cover (LUC) changes with OpenLand, your raster data must meet specific format and naming requirements. This guide covers the essential steps for preparing your data.Raster Naming Requirements
OpenLand requires rasters to follow a strict naming convention to extract temporal information:Format: name_year
Each raster layer must be named with:
- A descriptive text prefix (can be any text)
- An underscore separator
_ - A four-digit year
Valid Examples
Invalid Examples
The
contingencyTable() function extracts years from raster names by splitting on the underscore character and parsing the last component as the year.Supported Raster Formats
OpenLand accepts raster data in three different input formats:1. RasterBrick
A multi-layer raster object where all layers share the same extent and resolution:2. RasterStack
A collection of raster layers that can come from different files:3. Folder Path
Provide a path to a directory containing raster files:When using a folder path, all raster files in the directory will be loaded. Ensure only your LUC time series rasters are present in the folder and that they all follow the
name_year naming convention.Pixel Resolution Considerations
Specifying Resolution
Thepixelresolution parameter in contingencyTable() must be specified in meters:
Why Resolution Matters
Pixel resolution is used to convert pixel counts to area measurements in km²:Accurate pixel resolution is critical for:
- Converting pixel counts to real-world area (km²)
- Calculating change intensities
- Interpreting analysis results correctly
Data Consistency Requirements
All rasters in your time series must have:- Same extent - Identical geographic boundaries
- Same resolution - Identical pixel size
- Same projection - Identical coordinate reference system
- Same categories - Consistent land use classification scheme
What summary_dir() Returns
What summary_dir() Returns
The
summary_dir() function lists for each raster:- Spatial extension (bounding box)
- Spatial resolution (cell size)
- Cartographic projection (CRS)
- Category range (unique pixel values)
Time Interval Handling
OpenLand automatically calculates time intervals from raster names and supports both regular and irregular intervals.Regular Intervals
Time series with consistent spacing between observations:Irregular Intervals
Time series with varying spacing between observations:How Intervals Are Calculated
OpenLand automatically computes intervals for each transition:Total Interval
The total interval spans from the first to the last year:Intensity Analysis properly accounts for irregular intervals by computing annualized intensities. This means you can analyze time series with varying temporal spacing without data manipulation.
Complete Data Preparation Workflow
Here’s a recommended workflow for preparing your data:Step 1: Organize Your Rasters
Step 2: Verify Consistency
Step 3: Load as RasterStack
Step 4: Create Contingency Table
Step 5: Edit Legend
Common Issues and Solutions
Error: Raster names don't contain years
Error: Raster names don't contain years
Problem: Rasters aren’t named in
name_year format.Solution: Rename your rasters to include an underscore followed by a 4-digit year:Error: Rasters have different extents or resolutions
Error: Rasters have different extents or resolutions
Problem: Input rasters aren’t spatially aligned.Solution: Reproject and resample rasters to match:
Need at least 2 rasters error
Need at least 2 rasters error
Problem: Only one raster provided.Solution: OpenLand requires at least two time points to analyze change. Ensure you have a minimum of two rasters in your time series.
Best Practices
-
Use descriptive prefixes: Choose a raster name prefix that clearly identifies your study area
- Keep consistent intervals when possible: While irregular intervals are supported, regular intervals simplify interpretation
- Document your pixel resolution: Keep a record of the sensor/source and native resolution of your data
- Validate category consistency: Ensure the same land use classification scheme is applied across all years
- Use meaningful category codes: Assign consistent numeric codes to land use categories across all rasters
- Back up original data: Always work with copies of your raster data
- Test with a subset first: If working with large rasters, test your workflow on a small spatial subset before processing the full dataset