Difference between revisions of "Exercise: A spatial model of a catchment"

From OSGeo
Jump to navigation Jump to search
 
Line 9: Line 9:
  
 
# open land cover raster
 
# open land cover raster
 
 
# zoom to probable catchment area (rather too large than too small!)
 
# zoom to probable catchment area (rather too large than too small!)
 
 
# clip a piece of the land cover, name it "lc" (*)
 
# clip a piece of the land cover, name it "lc" (*)
 
 
# make a 'lakes' raster by saying $lakes = $lc == 43 (or whatever the land cover code for water is) [TODO: add instructions for removing streams from the lakes raster]
 
# make a 'lakes' raster by saying $lakes = $lc == 43 (or whatever the land cover code for water is) [TODO: add instructions for removing streams from the lakes raster]
 
 
# give unique id's for all lakes: $lakes->number_areas
 
# give unique id's for all lakes: $lakes->number_areas
 
 
# open a DEM raster
 
# open a DEM raster
 
 
# clip a similar piece(***) of the dem, name it 'dem'
 
# clip a similar piece(***) of the dem, name it 'dem'
 
 
# compute pitless flow direction grid: say(**) $fdg = $dem->filldepressions (*4)
 
# compute pitless flow direction grid: say(**) $fdg = $dem->filldepressions (*4)
 
 
# fix the FDG so that each lake has one and only one outlet, say: $fdg->kill_extra_outlets($lakes)
 
# fix the FDG so that each lake has one and only one outlet, say: $fdg->kill_extra_outlets($lakes)
 
 
# compute upslope area grid, say: $uag = $fdg->uag
 
# compute upslope area grid, say: $uag = $fdg->uag
 
 
# search for the catchment (lake) outlet cell and compute a catchment raster: $c = $fdg->catchment(<coordinates>)
 
# search for the catchment (lake) outlet cell and compute a catchment raster: $c = $fdg->catchment(<coordinates>)
 
 
# compute a streams raster from the $uag: $s = $uag > x
 
# compute a streams raster from the $uag: $s = $uag > x
 
 
# remove very short streams: $s->prune($fdg, $lakes, <coordinates>, $l)
 
# remove very short streams: $s->prune($fdg, $lakes, <coordinates>, $l)
 
 
# give unique id's for each stream segment: $s->number_streams($fdg, <coordinates>);
 
# give unique id's for each stream segment: $s->number_streams($fdg, <coordinates>);
 
 
# compute a subcatchments raster and topology information: ($sc, $topo) = $s->subcatchments($fdg, $lakes, <coordinates>)
 
# compute a subcatchments raster and topology information: ($sc, $topo) = $s->subcatchments($fdg, $lakes, <coordinates>)
 
 
# save the subcatchment structure as an OGR vector layer: $sc->save_catchment_structure($topo, $s, $lakes, $ogr_datasource, $layer)
 
# save the subcatchment structure as an OGR vector layer: $sc->save_catchment_structure($topo, $s, $lakes, $ogr_datasource, $layer)
  

Revision as of 10:10, 28 May 2006

Note 1: this exercise is designed to be used with libral and Gtk2::Ex::Geo tools. Note 2: the tools have to be currently the CVS versions

Required data: a land cover raster and a DEM

["http://map.hut.fi/PerlForGeoinformatics/", More information about the tools]

Steps of the exercise:

  1. open land cover raster
  2. zoom to probable catchment area (rather too large than too small!)
  3. clip a piece of the land cover, name it "lc" (*)
  4. make a 'lakes' raster by saying $lakes = $lc == 43 (or whatever the land cover code for water is) [TODO: add instructions for removing streams from the lakes raster]
  5. give unique id's for all lakes: $lakes->number_areas
  6. open a DEM raster
  7. clip a similar piece(***) of the dem, name it 'dem'
  8. compute pitless flow direction grid: say(**) $fdg = $dem->filldepressions (*4)
  9. fix the FDG so that each lake has one and only one outlet, say: $fdg->kill_extra_outlets($lakes)
  10. compute upslope area grid, say: $uag = $fdg->uag
  11. search for the catchment (lake) outlet cell and compute a catchment raster: $c = $fdg->catchment(<coordinates>)
  12. compute a streams raster from the $uag: $s = $uag > x
  13. remove very short streams: $s->prune($fdg, $lakes, <coordinates>, $l)
  14. give unique id's for each stream segment: $s->number_streams($fdg, <coordinates>);
  15. compute a subcatchments raster and topology information: ($sc, $topo) = $s->subcatchments($fdg, $lakes, <coordinates>)
  16. save the subcatchment structure as an OGR vector layer: $sc->save_catchment_structure($topo, $s, $lakes, $ogr_datasource, $layer)

footnotes:

(*) the clipped piece is automatically a plain libral raster, it may (and should) be saved by saying(**) $lc-save('lc'); later the saved raster may be opened in the usual way, but it needs to be "librated" by clipping to <self>

(**) "say", means write to the combo box, i.e. the command line interface

(***) in the clip dialog, select a raster to make a raster that is overlayable to it

(*4) this can be checked by saying: p($self,$fdg->contents), which computes the contents (number of cells having different values) and prints it