[GRASS-user] elevation values of watershed basins

Dylan Beaudette dylan.beaudette at gmail.com
Mon Feb 5 16:45:48 EST 2007

On Thursday 01 February 2007 08:27, temiz wrote:
> Dylan Beaudette wrote:
> > On Wednesday 31 January 2007 05:14, Markus Neteler wrote:
> >> temiz wrote on 01/31/2007 06:53 PM:
> >>> hello
> >>>
> >>> Can you make a suggestion about how I can find the highest and lowest
> >>> elevation points of all watershed basins
> >>> as vector points ?
> >>>
> >>> I mean, I have watershed map as vector. I need it's table includes
> >>> like "cat", "highest elevation value", "lowest elevation value"
> >>>
> >>> How can I do that ?
> >>
> >> If I understand your question correctly, you can do this easily with
> >>
> >> v.rast.stats
> >> Description:
> >>  Calculates univariate statistics from a GRASS raster map based on
> >> vector objects
> >>
> >> The help page contains a similar example.
> >>
> >> cheers
> >> Markus
> >
> > If you have problems with this approach (no reason to suspect problems),
> > I have found that 'starspan' coupled with GRASS to be an excellent
> > raster+vector reporting tool.
> >
> > main idea:
> >
> > start grass
> > starspan --vector location/mapset/vector/yourvector \
> > --raster location/mapset/cellhd/your_raster \
> > --stats output.csv min max avg mode (...)
> >
> > Output is saved to a CSV file, not quite as nice as v.rast.stats saving
> > results back to the attribute table though... The nice thing about this
> > approach is that the raster and vector sources can be any GDAL-readable
> > data type. For example, I use starspan to compute raster statistics
> > within a given radius of a set of points. The raster files are all stored
> > in GRASS, and the points are stored in PostGIS.
> >
> > Cheers,
> /*thank you
> */

Hi Ahmet,

> /*I have never met  */starspan so far. I am looking at its home page and
> it will certain to be very useful.
> I will work on it.

Be sure to, it is a simple compile from source code if you have both GDAL and 
GEOS installed with their include files.

> As I see, you are a soil scientist, so you will understand me better.

:) possibly...

> The logic of my question is based on finding slopes' length as landslide
> susceptibility parameter ( I accept slope is waterhed area).

so: landslide susceptibility ~ f( slope length ) --> this is a simple 
raster-based operation: calculate the upslope contributing area for each cell 
of a DEM. Check the literature for ideas. 

I am not entirely sure I understand what you are trying to do... Are you 
trying to estimate a landslide potential for each watershed boundary polygon?

> Firstly, I used PostGis's extent function and got width and length of
> polygons (say watershed or  landslide as polygon). But this
> polygon's longest dimension doesn't fit dimension in downslope
> direction, which is the slope length I am looking for. So, if I found
> max and min values of elevation of the polygons, I could calculate
> slopes' length.

This does not sound like a realistic solution, as the extent() function will 
return a minimum bonding box -- which provides the maximum 'length' 
and 'width' of some polygon, but not much useful information.

> /*v.rast.stats */gives max and min values of elevation of the polygons(
> /*v.rast.stats*/ has  still been running for most 20 hours).
> maybe from these values I generate vector points containing min & max
> values .

Do you have a number of polygons, and the specifications for your DEM: cell 
size, region size? You may have hit some upper boundary for v.rast.stats. 
Starpan seems to scale very well, so you may not run into this problem.

> I will appreciate if you supply your ideas and recommendations
> regards

Sure. With a clearer statement of the problem, and some information on your 
source data it may be possible to come up with a workable solution.


Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis

More information about the grass-user mailing list