howtos:how_to_calculate_an_area-weighted_average_in_grass
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| howtos:how_to_calculate_an_area-weighted_average_in_grass [2026-10-23 01:38 am] – hcho | howtos:how_to_calculate_an_area-weighted_average_in_grass [2026-11-07 03:12 pm] (current) – hcho | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| <code bash> | <code bash> | ||
| # set the computational region to the value raster | # set the computational region to the value raster | ||
| - | g.region rast=rast_val | + | g.region rast=val_rast |
| # convert the value raster to area vector | # convert the value raster to area vector | ||
| - | r.to.vect | + | r.to.vect |
| - | + | ||
| - | # calculate the areas of the area vector polygons | + | |
| - | v.to.db vect_val op=area col=area_m2 | + | |
| # overlay the value vector OR the area vector | # overlay the value vector OR the area vector | ||
| - | v.overlay ainput=vect_val | + | v.overlay ainput=val_vect |
| + | |||
| + | # calculate the areas of the value-OR-area vector polygons | ||
| + | v.to.db val_area_vect op=area col=area_m2 | ||
| # add a new column for the area-weighted average | # add a new column for the area-weighted average | ||
| - | v.db.addcolumn | + | v.db.addcolumn |
| # populate the new column with the area-weighted average | # populate the new column with the area-weighted average | ||
| - | v.db.update | + | v.db.update |
| - | qcol=" | + | qcol=" |
| - | | + | |
| </ | </ | ||
howtos/how_to_calculate_an_area-weighted_average_in_grass.1792719488.txt.gz · Last modified: by hcho