[GRASS-user] elevation values of watershed basins

Dylan Beaudette dylan.beaudette at gmail.com
Wed Jan 31 13:14:50 EST 2007


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,



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




More information about the grass-user mailing list