Raster Analysis
Measuring cells
Perimeter = # of cells of the perimeter * resolution
- Perimeter of cells is more estimated than calculated
- Units are the same as the units in the resolution
- For vector analysis, we calculate the perimeter based on the coordinates, so it is more precise than in raster analysis
\ Problem: the more complex the polygon, the more grid cells will be at the diagonal to their neighbour, resulting in less accurate results
- Pythagoras theorem to find the diagonal distance of the cell (L2 = d12 + d22 = 2*d2)
- Diagonal distance > lateral distance
\ Area = # of cells * area of a cell
- Area of a cell is calculated by the resolution
\
Measuring distance
There are 2 ways of measuring distance in raster data:
- Euclidean distance
1. For each cell, the distance is calculated to the source cells(s) by calculating the hypotenuse of the square triangle and multiplying the distance by the resolution
- Cell distance
1. Calculate the distance for the origin through the center of neighboring cell * Useful for calculating the path from different points of the grid (i.e. shortest path) * Useful for cost distance
\
Cost distance
Calculates the least accumulative cost distance for each cell from or to the least-cost source over a cost surface.Method of calculating cost distance, is by calculating the cost of the links between the cells or the importance of each cell:
*Lateral link = 1 * ((Ci + Cj)/2)
Diagonal link: 1.414 * ((Ci + Cj)/2)
Where:
- Ci – Value of cell i (seen in Cost_Ras)
- Cj – value of cell j (seen in Cost_Ras)
\ From the cost distance, derive the accumulative cost path and choose the least accumulative cost path
- Sum of all the accumulative cost between a destination and the source
- Keep the path with the lowest value
\ Requires: a source raster, a cost raster, derived distance cost, a destination, and an algorithm for calculating the least cost path
\
Convert raster to vector, vector to raster
Transform a raster file into a vector file (features)
- All neighboring cells are connected to each other to determine line or polygon limits
- Points become the center
Converting vector to raster
- The value of each cell is based on the value of ONE selected field
- Different methods to determine the value of a cell sharing multiple polygons
- Errors are common in the converting process
\
Raster analysis – Operators and Functions
The functions associated with raster cartographic modeling can be divided into five types:
- Local functions * Works on a cell in a single location
- Focal functions * Work on cell locations within a neighbourhood
- Zonal functions * Work on cell locations within zones
- Global functions * Work on all cells within the raster
- Applications * Those that preform a specific applications (i.e. hydrologic analysis function)
\
Raster Overlay
Overlaying data means to put the data on top of each other, allowing us to combine several grids and produce a new raster layer.
- Combine 2 or more raster files
- You may need to reclassify one (or more) of the files to create a useful overlay
- Raster calculator - use arithmetic, logical, and Boolean operators to select areas of interest
\ You can add one grid to another one:
- The 0-class typically refers to a component that we are not interested in investigating
\ Masking allows selection of pixels from one grid based on pixels from another grid when we are overlaying raster data:
- Mask grid must be binary (0 or 1) * 0 = I don’t want * 1 = I want
- The mask can be used to ‘clip’ other layers
\ If one grid has a higher resolution compared to another, you should divide the bigger resolution one to match the smaller resolution grid to not lose information (Resampling)