[GRASS-user] elevation values of watershed basins

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 ?

regards

--
Ahmet Temiz

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Temiz,

One way you could do it is this:

(1) create a raster mask for each basin
(2) for each basin, with the mask set, use r.describe to get the range in values (which gives the max)
(3) use r.mapcalc to set all but max. values to NULL
(4) use r.to.vect to convert the raster (max. elevation points) to vector points
(5) export the vector point(s) to an ascii file (if this is your goal)

So, this could be put into a shell script and automated for lots of basins. I'm sure there are other ways of doing this, but this is what came to mind.

Regards,
Tom

temiz wrote:

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 ?

regards

--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL: thomas.adams@noaa.gov

VOICE: 937-383-0528
FAX: 937-383-0033

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

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

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
*/

/*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.

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

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

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.

/*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 .

I will appreciate if you supply your ideas and recommendations

regards

/*
*/

--
Ahmet Temiz

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

temiz wrote:

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

I'm not, but maybe there is are ideas from other fields which can help-

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

Perhaps the concept of "fetch"? "The unobstructed region of the ocean
over which the wind blows to generate waves." The idea is the longer the
fetch, the greater height waves can grow. Your slope length seems like a
direct analogy, of sorts. Perhaps there are some fetch calculation
algorithms which may be applicable?

run r.watershed and get a basin and half-basin maps, r.to.vect,
then isolate half basin borders not matching basin borders.

This gives anti-ridges (obtain ridges with "r.param.scale par=feature").
The anti-ridges will be the landslide path? (I guess ridges of flow
accum river map will be the same thing?)

then use the river paths as a MASK and maybe r.cost with slope as cost
layer to see which basin (river) has the biggest cumulative slope?

shooting in the dark,
Hamish

temiz wrote:

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

r.watershed creates these maps, among others:

   length.slope slope length and steepness (LS) factor for USLE
slope.steepness slope steepness (S) factor for USLE

?
Hamish

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.

:slight_smile: 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.

Cheers,

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

Hi -

On Monday 05 February 2007 02:19, Hamish wrote:

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

I'm not, but maybe there is are ideas from other fields which can help-

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

Perhaps the concept of "fetch"? "The unobstructed region of the ocean
over which the wind blows to generate waves." The idea is the longer the
fetch, the greater height waves can grow. Your slope length seems like a
direct analogy, of sorts. Perhaps there are some fetch calculation
algorithms which may be applicable?

This is a good analogy for the dynamics of hillslopes: longer slope length per
unit of water = greater potential for erosion. Landslides would of course be
a bit more complex, but could follow a similar cascade-of-events type system:
like an avalanche in the snow.

run r.watershed and get a basin and half-basin maps, r.to.vect,
then isolate half basin borders not matching basin borders.

This gives anti-ridges (obtain ridges with "r.param.scale par=feature").
The anti-ridges will be the landslide path? (I guess ridges of flow
accum river map will be the same thing?)

then use the river paths as a MASK and maybe r.cost with slope as cost
layer to see which basin (river) has the biggest cumulative slope?

shooting in the dark,
Hamish

Those are some interesting shots, and definitely something to try. Slope
length (RUSLE) and 'contributing upslope area' (a couple of definitions of
this are out there see [1] for some definitions).

1. Wilson, J.P. & Gallant, J.C. Terrain Analysis : Principles and Applications
Wiley, 2000

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

Dylan Beaudette wrote:

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.
    
:slight_smile: 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?
  

     I am going to build the model using logistic regression ( in R - Stat).
      slope length is not only parameter.
     -- existing landslides are response variable
     -- rock type,slope angle, slope shape, aspect, slope length (** ??**) are the explatory variables.
     I have already constructed all maps except slope length.
     I am going to use watershed basin as slope unit in one model. So you are right, each watershed
     basin ( slope) I will generate unique landslide potential value. something like you see, landslide is
     a slope movement so I have to say, this slope is unstable but adjacent slope is stable)
     Unfortunately, while r.terraflow generates very good and realistic watershed basin map, it does not generate
    half basin map. ( as far as I see r.watershed's basin is not as good as r.terraflow's basin)

  

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.

Cheers,

--
Ahmet Temiz

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

On Thursday 08 February 2007 07:56, temiz wrote:

Dylan Beaudette wrote:
> 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.
>>
> :slight_smile: 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?

     I am going to build the model using logistic regression ( in R -
Stat). slope length is not only parameter.
     -- existing landslides are response variable
     -- rock type,slope angle, slope shape, aspect, slope length (**
??**) are the explatory variables.
     I have already constructed all maps except slope length.
     I am going to use watershed basin as slope unit in one model. So
you are right, each watershed
     basin ( slope) I will generate unique landslide potential value.
something like you see, landslide is
     a slope movement so I have to say, this slope is unstable but
adjacent slope is stable)

    Unfortunately, while r.terraflow generates very good and realistic
watershed basin map, it does not generate
    half basin map. ( as far as I see r.watershed's basin is not as good
as r.terraflow's basin)

Hi,

Unfortunately I cannot comment on the output from r.watershed vs.
r.terraflow -- you will need to talk to the developers about this.

Good luck,

Dylan

>> 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.
>
> Cheers,

--
Ahmet Temiz

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