Helena Mitasova
GIS/MEA582 Geospatial Modeling and Analysis NCSU
Can be applied as global, zonal, or neighborhood operations
See relevant equations and additional metrics in Supplemental material
Can be applied as global, zonal, or neighborhood operations
See relevant equations and additional metrics in Supplemental material
Continuous data example
Watersheds (discrete zones), Slope (continuous variable): Mean slope for each watershed
Watersheds (discrete zones), Land cover 1996 (discrete variable): Most common land cover
HI developed, LI developed, Southern pine, Hardwoods, Cultivated Herbaceous
Smoothing noise in DEM: mean with 5x5 window
Number of different landuse classes in 7x7 window
Map areas with homogeneous (single category) land use and its land use category
r.mapcalc "lu_singlecat = if(lu_diversity == 1, landuse, null())"
Computes a new raster map using an expression built by applying logical and/or arithmetic operators, or mathematical functions to existing raster maps:
newmap = expression (map1, map2, ...map3)
Local operation: Expression is applied on per-cell basis
Each software has its own syntax, operators and functions
if(x), if(x,a,b)
exp(x,y), sin(x), log(x)
min(x1,x2,..), max(), median()
See GRASS GIS map algebra manual page for extensive set of supported operators and mathematical functions
GRASS GIS expression
forest_z = if(landc==5 && elev > 120., elev, null())
forest_z = if(landc==5 && elev > 120., elev, null())
How will the map look like if we use OR (||) instead of AND (&&) ?
Integer and floating point matters for arithmetic expressions:
ndvi=(tm4-tm3)/(tm4+tm3)
ndvi=float(tm4-tm3)/float(tm4+tm3)
ndvi=1.*(tm4-tm3)/(tm4+tm3)
ndvi=(tm4-tm3)/(tm4+tm3)
This is to illustrate the arithmentic operators,
note that various vegetation indices are usually implemented
as a separate module, e.g. i.vi
in GRASS GIS
ndvi=float(tm4-tm3)/float(tm4+tm3)
This is to illustrate the arithmentic operators,
note that various vegetation indices are usually implemented
as a separate module, e.g. i.vi
in GRASS GIS
Example: for all forested areas, compute sediment transport capacity $T$ using the following equation
$$T = A^{1.5} \sin \beta$$
where
GRASS GIS expression
t_sed = if(landc==5, exp(area,1.5) * sin(slope), null())
Generate a plane related to existing surface
plane = a*row() + b*col()
tiltplane = 0.2*(0.1*row()+col())+50
tiltpl_elev = if(tiltplane < elev_lid792_1m + 2,tiltplane,null())
Generate a plane related to existing surface
Compute average elevation from 30m SRTM and one tile of 6m NCFlood DEM
elev_avg=(elev_srtm_30m+elevlid_D782_6m)/2.
Compute average elevation from 30m SRTM and one tile of 6m NCFlood DEM
elev_avg=(elev_srtm_30m+elevlid_D782_6m)/2.
Use “if” statement to limit the computation to no-NULL areas
Check the seams with aspect. If reprojection is needed, first mosaic, then reproject to avoid potential no-data slivers that need to be interpolated
Start with the map with most nulls (lakes), fill them in with values from additional raster map (elevation) and assign relevant color ramp
Aspect: linear reclassification of continuous values in degrees to discrete classes in cardinal directions
0- 45 = 4 East, 45-135 = 1 North, 135-225 = 2 West, 225-315 = 3 South, 315-360 = 4 East,
Slope: linear reclassification of continuous values to discrete classes
Slope intervals are same for each class, are computed as max_slope/number_of_classes leading to 6 classes with 7 degree interval
Slope: histogram equalized reclassification of continuous values to discrete classes
Slope intervals for each class are computed based on cumulative histogram so that each class has approximately the same area: 1-6 deg has six 1 degree intervals, 6-38 is a single interval
Rule-based Landcover to C-factor (soil erosion cover factor): categories to values in winter and summer
Winter - 1 pond : 0.000, 2 forest : 0.0005, 3 developed : 0.000, 4 bare : 0.8, 5 paved road : 0.000, 6 dirt road : 0.500 7 agriculture : 0.5, 8 grass = 0.005; Summer - 7 agriculture : 0.005