r.stream.extract with external flow accumulation maps

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

r.stream.extract with external flow accumulation maps

jentjr
All,

I am trying to use r.stream.extract with the National Hydrography Dataset Plus, which includes elevation, flow direction and flow accumulation maps. I recently read the paper by Jasiewicz and Metz that states, "...network modeling is based on accumulation maps that are created internally or created with an external GIS software or as the result of map algebra." However, I get the following when I try to use the module with the NHDPlus data:

ERROR: Accumulation map does not match elevation map!

Should I be getting this error message?

Thank you,

Justin Jent
Reply | Threaded
Open this post in threaded view
|

Re: r.stream.extract with external flow accumulation maps

sinnfluter

Am 27.06.2011 um 02:56 schrieb jentjr:

> All,
>
> I am trying to use r.stream.extract with the National Hydrography Dataset
> Plus, which includes elevation, flow direction and flow accumulation maps. I
> recently read the paper by Jasiewicz and Metz that states, "...network
> modeling is based on accumulation maps that are created internally or
> created with an external GIS software or as the result of map algebra."
> However, I get the following when I try to use the module with the NHDPlus
> data:
>
> ERROR: Accumulation map does not match elevation map!

I think you have to have all the input maps with the same spatial extend and the
same grid resolution to be able to process it with r.stream.*
Did you check for that?

/johannes

>
> Should I be getting this error message?
>
> Thank you,
>
> Justin Jent
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/r-stream-extract-with-external-flow-accumulation-maps-tp6518518p6518518.html
> Sent from the Grass - Users mailing list archive at Nabble.com.
> _______________________________________________
> grass-user mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-user

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: r.stream.extract with external flow accumulation maps

Markus Metz-2
On Mon, Jun 27, 2011 at 8:03 AM, Johannes Radinger <[hidden email]> wrote:

>
> Am 27.06.2011 um 02:56 schrieb jentjr:
>
>> All,
>>
>> I am trying to use r.stream.extract with the National Hydrography Dataset
>> Plus, which includes elevation, flow direction and flow accumulation maps. I
>> recently read the paper by Jasiewicz and Metz that states, "...network
>> modeling is based on accumulation maps that are created internally or
>> created with an external GIS software or as the result of map algebra."
>> However, I get the following when I try to use the module with the NHDPlus
>> data:
>>
>> ERROR: Accumulation map does not match elevation map!
>
> I think you have to have all the input maps with the same spatial extend and the
> same grid resolution to be able to process it with r.stream.*
> Did you check for that?
>
Matching extents are not required, but if the accumulation map has
been computed for only a part of the elevation map, the current region
must be set to the accumulation map, not the elevation map. Then it
should work. Alternatively, create a MASK with value NULL where the
accumulation map is NULL, otherwise 1 (or anything but NULL or zero).
The resolution of the elevation map and the accumulation map should
always match.

Markus M
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: r.stream.extract with external flow accumulation maps

jentjr
Thank you for the replies. I set the region to the flow accumulation map, and I still received the error though. Here is the region output for both the elevation and flow accumulation maps

Elevation:
 
GRASS 6.4.1 (NAD83_GRS80_LCC):~ > g.region -p rast=elev_cm@hydrology
projection: 99 (Lambert Conformal Conic)
zone:       0
datum:      nad83
ellipsoid:  grs80
north:      276735
south:      182265
west:       111075
east:       398265
nsres:      30
ewres:      30
rows:       3149
cols:       9573
cells:      30145377

Flow accumulation:

GRASS 6.4.1 (NAD83_GRS80_LCC):~ > g.region -p rast=fac@hydrology
projection: 99 (Lambert Conformal Conic)
zone:       0
datum:      nad83
ellipsoid:  grs80
north:      276705
south:      182025
west:       110445
east:       399105
nsres:      30
ewres:      30
rows:       3156
cols:       9622
cells:      30367032


I also tried setting a mask

r.mapcalc 'new_fac=if(fac==null(),null(),1)'
r.mask input=new_fac

GRASS 6.4.1 (NAD83_GRS80_LCC):~ > r.stream.extract elevation=elev_cm@hydrology accumulation=fac@hydrology stream_rast=rstream5K stream_vect=rstream5K threshold=5000 direction=rstream5K_fdr

ERROR: Accumulation map does not match elevation map!
[Raster MASK present]


Reply | Threaded
Open this post in threaded view
|

Re: r.stream.extract with external flow accumulation maps

Jarekj Jasiewicz
On 06/27/2011 01:44 PM, jentjr wrote:

> Thank you for the replies. I set the region to the flow accumulation map, and
> I still received the error though. Here is the region output for both the
> elevation and flow accumulation maps
>
> Elevation:
>
> GRASS 6.4.1 (NAD83_GRS80_LCC):~>  g.region -p rast=elev_cm@hydrology
> projection: 99 (Lambert Conformal Conic)
> zone:       0
> datum:      nad83
> ellipsoid:  grs80
> north:      276735
> south:      182265
> west:       111075
> east:       398265
> nsres:      30
> ewres:      30
> rows:       3149
> cols:       9573
> cells:      30145377
>
> Flow accumulation:
>
> GRASS 6.4.1 (NAD83_GRS80_LCC):~>  g.region -p rast=fac@hydrology
> projection: 99 (Lambert Conformal Conic)
> zone:       0
> datum:      nad83
> ellipsoid:  grs80
> north:      276705
> south:      182025
> west:       110445
> east:       399105
> nsres:      30
> ewres:      30
> rows:       3156
> cols:       9622
> cells:      30367032
>
>
> I also tried setting a mask
>
> r.mapcalc 'new_fac=if(fac==null(),null(),1)'
> r.mask input=new_fac
>
> GRASS 6.4.1 (NAD83_GRS80_LCC):~>  r.stream.extract
> elevation=elev_cm@hydrology accumulation=fac@hydrology stream_rast=rstream5K
> stream_vect=rstream5K threshold=5000 direction=rstream5K_fdr
>
> ERROR: Accumulation map does not match elevation map!
> [Raster MASK present]
>
>
>
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/r-stream-extract-with-external-flow-accumulation-maps-tp6518518p6521518.html
> Sent from the Grass - Users mailing list archive at Nabble.com.
> _______________________________________________
> grass-user mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-user
it looks like the accum map has bigger extend than DEM. Try to cut both
maps to the same extend. It should help
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: r.stream.extract with external flow accumulation maps

jentjr
I also tried that by first setting the region equal to the elevation map and then using r.mapcalc to create a new accumulation map. Both the elevation and accumulation maps have the same spatial extent and resolution, but I still get the error.

I believe that the flow accumulation grid was produced using ArcHydro. I put the link to the data set that I am using below if anyone wants to try it out.

http://www.horizon-systems.com/nhdplus/HSC-wth21.php



Reply | Threaded
Open this post in threaded view
|

Re: r.stream.extract with external flow accumulation maps

Mark Seibel
> I believe that the flow accumulation grid was produced using ArcHydro. I put
> the link to the data set that I am using below if anyone wants to try it
> out.

Hi.  Not sure if this is the issue, but I recall this from the manual.

"
accumulation
Input map, optional: Accumulation values of the provided accumulation
map are used and not calculated from the input elevation map. If
accumulation is given, elevation must be exactly the same map used to
calculate accumulation. If accumulation was calculated with
r.terraflow, the filled elevation output of r.terraflow must be used.
Further on, the current region's resolution should be identical to the
accumulation map. Flow direction is first calculated from elevation
and then adjusted to accumulation. It is not necessary to provide
accumulation as the number of cells, it can also be (adjusted) total
contributing area in square meters or any other unit.
"

Mark
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: r.stream.extract with external flow accumulation maps

Jarekj Jasiewicz
On 06/27/2011 05:12 PM, Mark Seibel wrote:

>> I believe that the flow accumulation grid was produced using ArcHydro. I put
>> the link to the data set that I am using below if anyone wants to try it
>> out.
> Hi.  Not sure if this is the issue, but I recall this from the manual.
>
> "
> accumulation
> Input map, optional: Accumulation values of the provided accumulation
> map are used and not calculated from the input elevation map. If
> accumulation is given, elevation must be exactly the same map used to
> calculate accumulation. If accumulation was calculated with
> r.terraflow, the filled elevation output of r.terraflow must be used.
> Further on, the current region's resolution should be identical to the
> accumulation map. Flow direction is first calculated from elevation
> and then adjusted to accumulation. It is not necessary to provide
> accumulation as the number of cells, it can also be (adjusted) total
> contributing area in square meters or any other unit.
> "
>
> Mark

This error message appears when there are nulls in accum map in the
interest area. Try to change nulls to different values let say 0 and
tell what happened.
J.
> _______________________________________________
> grass-user mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-user

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: r.stream.extract with external flow accumulation maps

jentjr
It worked! I also tried it without changing the spatial extent of the map and it worked. So, I just needed to set the null values to zero.

Thanks for the patience,

Justin Jent
Reply | Threaded
Open this post in threaded view
|

Re: r.stream.extract with external flow accumulation maps

Markus Metz-2
On Tue, Jun 28, 2011 at 5:06 AM, jentjr <[hidden email]> wrote:
> It worked! I also tried it without changing the spatial extent of the map and
> it worked. So, I just needed to set the null values to zero.
>
Hmm, this is not such a good idea, the zeros can have interesting
effects. Rather create a MASK where either accumulation or elevation
or both are NULL.

The accumulation map does indeed not match the elevation map. Another,
modified elevation map was used to create the accumulation map. The
accumulation map is full of artefacts that are not present in the
elevation map. You can compare the accumulation map produced by
r.watershed with the accumulation map supplied on the website. For
easy visual comparison, use r.watershed -a and set the color rules of
"fac" to those of the output of r.watershed, e.g.
r.colors map=fac raster=elev_cm.ac

Markus M
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user