Re: [GRASS-user] r.stream.extract Syntax Problem

2012-04-10 Thread Markus Metz
[Answering to your latest post in a new thread, but I prefer to keep
it all in one thread.]


On Tue, Apr 10, 2012 at 1:54 AM, Rich Shepard rshep...@appl-ecosys.com wrote:
 On Mon, 9 Apr 2012, Markus Metz wrote:

 The computational region should be aligned to the DEM in order to get
 accurate results. Aligning to the resolution of the DEM is not enough,
 i.e. you should use g.region align=DEM instead of g.region res=XXX -a.
 r.stream.extract should work if only a subregion is to be analysed by
 setting the computational region accordingly and/or creating a MASK e.g.
 for a specific basin.


 Markus, madi, et al.:

  The region does need to be set with a mask (in my case, and based on the
 v.to.rast output of the individual subbasins).

v.to.rast? Basins as created by r.watershed, r.stream.basins and
r.water.outlet are already raster maps.

  The last advice in the example on the manual page is to compare the
 weighted and unweighted extracted stream maps and see which looks better.
 As a newcomer to this module I have no experience on what better looks
 like.

  Attached are two .pdf files. One shows the weighted output streams, the
 other the unweighted output streams. Both have the vector streams overlaid
 on them. The weighted output has a solid yellow background and I don't know
 what that represents.

In this case there is indeed no answer to what looks better because
both look terrible, to be honest. Something terrible must have
happened to the DEM, or there are indeed completely flat areas in the
west. If the aim is to extract streams that resemble the digitized
vector lines, the DEM you used seems to be not suitable. You could try
to run r.stream.extract with the DEM as the only input and a larger
threshold. The region should be aligned to the DEM first with g.region
-p align=dem. If that produces reasonable results, you can try to
fine-tune by adjusting the threshold and supplying a (weighed)
accumulation map as additional input.

Markus M

PS: Please do not change the thread all the time. With regard to this
subject, you have started now the 7th or so thread, I lost count,
impossible for anyone to follow.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.stream.extract Syntax Problem

2012-04-09 Thread Rich Shepard

On Sat, 7 Apr 2012, Margherita Di Leo wrote:


Do you produce any null cells when you weight the flow acc? I'm not sure
but I guess this could also be a problem (?)


madi,

  I don't know. How do I determine if null cells are produced (look at
r.null.fill output, perhaps)?

Rich

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.stream.extract Syntax Problem

2012-04-09 Thread Margherita Di Leo
Rich,

On Mon, Apr 9, 2012 at 10:07 PM, Rich Shepard rshep...@appl-ecosys.comwrote:

 On Sat, 7 Apr 2012, Margherita Di Leo wrote:

  Do you produce any null cells when you weight the flow acc? I'm not sure
 but I guess this could also be a problem (?)


 madi,

  I don't know. How do I determine if null cells are produced (look at
 r.null.fill output, perhaps)?


You said you produce the accumulation map by:

r.mapcalc elevation.10m.acc.weighed = elevation.10m.acc * weight

The map namely weight shouldn't have null values (use r.null to set null
values to zero).

Best,
madi

-- 
Ing. Margherita Di Leo, Ph.D.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.stream.extract Syntax Problem

2012-04-09 Thread Rich Shepard

On Sat, 7 Apr 2012, Micha Silver wrote:


Maybe the MASK is somehow interfereing   ??


Micha,

  This is apparently not the issue. I followed Helmut's suggestion and set
the proessing region using the vector boundary of one subbasin. Still the
same error: accumulation map does not match elevation map.

  What would be very helpful in fixing this mis-match is understanding in
what way the accumulation map does not match the elevation map. Is it the
region (set to the elevation map) or some other parameter?

Rich

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.stream.extract Syntax Problem

2012-04-07 Thread Rich Shepard

On Sat, 7 Apr 2012, Micha Silver wrote:


Maybe the MASK is somehow interfereing   ??


Micha,

  I wondered about this. The unweighted accumulation map does not generate
the error, yet the same mask is applied. But, this may be why the weighted
accumulation map does not throw an error if the entire elevation map is the
analytical unit.

  Each of my two current projects requiring spatial analyses involve
multiple 12-digit HUC basins (sub-watersheds). I need to separately analyze
each sub-watershed to determine differences. I can clip vector maps by
interescting the lines and the sub-watershed boundaries. But, my
understanding is that raster maps cannot be subdivided in the same way so
we need to generate masks for the areas to be included in each analysis.
That is, r.* modules are applied to only those portions of the overall DEM
map within the mask.

  If there is a module, or process (perhaps applying r.mapcalc for the map
algebra), that will allow me to create separate DEMs for each sub-watershed
(or other analytical unit) I would prefer to work with each of those rather
than need to run r.mask for each different basin. I'd like to learn how to
sub-set raster DEMs so each basin is a separate map rather than a masked
portion.

Thanks,

Rich




___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.stream.extract Syntax Problem

2012-04-07 Thread Rich Shepard

On Sat, 7 Apr 2012, Margherita Di Leo wrote:


That's what I thought. Or else a g.region problem??


madi,

  In this case r.stream.extract would through an error for the unweighted
accumulation map, too. Unless weighing each cell in the accumulation map
changes the region in a way that's not obviously visible?

Rich

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.stream.extract Syntax Problem

2012-04-07 Thread Margherita Di Leo
Rich,

On Sat, Apr 7, 2012 at 3:39 PM, Rich Shepard rshep...@appl-ecosys.comwrote:

 On Sat, 7 Apr 2012, Margherita Di Leo wrote:

  That's what I thought. Or else a g.region problem??


 madi,

  In this case r.stream.extract would through an error for the unweighted
 accumulation map, too. Unless weighing each cell in the accumulation map
 changes the region in a way that's not obviously visible?


Do you produce any null cells when you weight the flow acc? I'm not sure
but I guess this could also be a problem (?)

madi



 Rich


 __**_
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/**mailman/listinfo/grass-userhttp://lists.osgeo.org/mailman/listinfo/grass-user




-- 
Ing. Margherita Di Leo, Ph.D.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.stream.extract Syntax Problem

2012-04-06 Thread Margherita Di Leo
Hi Rich,

AFAIK (but surely Markus Metz will give an insight) r.stream.extract must
run with flow accumulation produced by r.watershed. In order to use a
weighted flow accumulation, I would produce it using the r.watershed
command with the option flow, instead of mapcalc.

HTH
madi

On Thu, Apr 5, 2012 at 11:29 PM, Rich Shepard rshep...@appl-ecosys.comwrote:

  I'm learning to use r.stream.extract by following the detailed example on
 the manual page. The last two steps are to extract steam maps using both
 weighted and unweighted accumulation maps. The example syntax is:

 # extract streams
 r.stream.extract elevation=elevation.10m@**PERMANENT \
 accumulation=elevation.10m.**acc.weighed \
 threshold=1000 \
 stream_rast=elevation.10m.**streams

 And the example syntax to create the weighted flow accumulation map is:

 # weigh accumulation map
 r.mapcalc elevation.10m.acc.weighed = elevation.10m.acc * weight

  For one of my sub-watersheds I ran the following:

 r.mapcalc dem10m.acc.weighted = dem10m.acc * weight

 (all on one line but it may wrap to two lines when you view it).

 I check that this worked properly by displaying demm10m.avg on d.mon x0,
 then
 displaying dem10m.acc.weighted on the same monitor. The two maps are
 congruent. So,
 when I run r.stream.extract I get an error that the accumulation map does
 not match the elevation map from which r.mapcalc created it:

 r.stream.extract elevation=dem10m.avg accumulation=dem10m.acc.**weighted
 threshold=1000 stream_rast=dem10m.streams

 (NOTE: again, all on one line, but may display on two lines.)

 Load input maps and get start points...
 ERROR: Accumulation map does not match elevation map!

  There is no error with the unweighted accumulation map (dem10m.acc).

  I'm not seeing why this error is generated, and need to understand why so
 I can model a dozen or so small basins.

 TIA,

 Rich

 __**_
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/**mailman/listinfo/grass-userhttp://lists.osgeo.org/mailman/listinfo/grass-user




-- 
Ing. Margherita Di Leo, Ph.D.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.stream.extract Syntax Problem

2012-04-06 Thread Rich Shepard

On Fri, 6 Apr 2012, Margherita Di Leo wrote:


AFAIK (but surely Markus Metz will give an insight) r.stream.extract must
run with flow accumulation produced by r.watershed. In order to use a
weighted flow accumulation, I would produce it using the r.watershed
command with the option flow, instead of mapcalc.


madi,

  As I wrote, I've been following the example on the manual page, so

# calculate flow accumulation
r.watershed ele=elevation.10m@PERMANENT acc=elevation.10m.acc -f

I've run r.watershed elev=dem10m.avg accum=dem10m.acc -f

Rich

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.stream.extract Syntax Problem

2012-04-06 Thread Margherita Di Leo
Rich,

On Fri, Apr 6, 2012 at 5:41 PM, Rich Shepard rshep...@appl-ecosys.comwrote:

 On Fri, 6 Apr 2012, Margherita Di Leo wrote:

  AFAIK (but surely Markus Metz will give an insight) r.stream.extract must
 run with flow accumulation produced by r.watershed. In order to use a
 weighted flow accumulation, I would produce it using the r.watershed
 command with the option flow, instead of mapcalc.


 madi,

  As I wrote, I've been following the example on the manual page, so

 # calculate flow accumulation
 r.watershed ele=elevation.10m@PERMANENT acc=elevation.10m.acc -f

 I've run r.watershed elev=dem10m.avg accum=dem10m.acc -f


I meant something like:

r.watershed ele=elevation.10m@PERMANENT acc=elevation.10m.weight_acc
flow=weight -f




 Rich

 __**_
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/**mailman/listinfo/grass-userhttp://lists.osgeo.org/mailman/listinfo/grass-user




-- 
Ing. Margherita Di Leo, Ph.D.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.stream.extract Syntax Problem

2012-04-06 Thread Micha Silver



--
Micha Silver
052-366-5918

-Original message-
From: Rich Shepard rshep...@appl-ecosys.com
To: grass-us...@lists.osgeo.org
Sent: Fri, 06 Apr 2012, 20:16:48 GMT+02:00
Subject: Re: [GRASS-user] r.stream.extract Syntax Problem

On Fri, 6 Apr 2012, Margherita Di Leo wrote:


I meant something like:
r.watershed ele=elevation.10m@PERMANENT acc=elevation.10m.weight_acc
flow=weight -f




followed by:

GRASS 6.5.svn :~/grassdata  r.stream.extract
elev=dem10m.avg accum=dem10m.acc.weighted thresh=1000  
stream_rast=dem10m.lm.streams

Load input maps and get start points...
ERROR: Accumulation map does not match elevation map!
[Raster MASK present]

Maybe the MASK is somehow interfereing   ??



Still the same error generated. I'm quite puzzled

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user