[GRASS-user] error: accumulation map does not match with elevation map!

Hi all. I need some help. I can not make good use of the Region of Sardinia dtm10 available at: http://webgis.regione.sardegna.it/Download/raccolteCartografiche/modelliDigitaliTerreno/DTM10m/
the amount. asc in location “EPSG 3003 sardinia”, but when I launch r.basin in a closing section of the basin, I get the error: “map of accumulations does not match the map of elevations.” Someone can help me?


Ing. Giuliano Urgeghe
Via Prunizzedda 61 - 07100 Sassari
giuliano.u@gmail.com
tel. 3283268186

but when I launch r.basin in a closing section of the basin, I get the

error: "map of accumulations

does not match the map of elevations."

r.basin is based upon r.stream.extract and other useful modules.

from the r.stream.extract-manual [1]:

[...]
If accumulation is given, elevation must be exactly the same map used to
calculate accumulation.
[...]

[1]
http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.stream.extract/description.html

HTH

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5029261.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Wed, Jan 23, 2013 at 1:21 PM, Helmut Kudrnovsky <hellik@web.de> wrote:

but when I launch r.basin in a closing section of the basin, I get the

error: "map of accumulations

does not match the map of elevations."

r.basin is based upon r.stream.extract and other useful modules.

The bug is in r.basin which modifies the current region after
r.watershed is called and before r.stream.extract is called, if the
default threshold should be used. In this case, the region is set to
match the input elevation map in order to get the resolution (nsres
only by the way). The fix would be to replace in r.basin.py line 135 -
137
        info_region = grass.read_command('g.region', flags = 'p', rast
= '%s' % (r_elevation))
        dict_region = grass.parse_key_val(info_region, ':')
        resolution = float(dict_region['nsres'])
with
        resolution = grass.region()['nsres']

HTH,

Markus M

from the r.stream.extract-manual [1]:

[...]
If accumulation is given, elevation must be exactly the same map used to
calculate accumulation.
[...]

[1]
http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.stream.extract/description.html

HTH

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5029261.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

I took your advice replacing lines 135-136 and 137 of the file, r.basin.py,
in the directory home/grass-addons/grass6/raster/r.basin by editor Kate
but I have not found any solution to the problem
also because I used a threshold value different from the default

thank for your help

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5029421.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Thu, Jan 24, 2013 at 12:43 AM, Giuliano Urgeghe <giuliano.u@gmail.com> wrote:

I took your advice replacing lines 135-136 and 137 of the file, r.basin.py,
in the directory home/grass-addons/grass6/raster/r.basin by editor Kate
but I have not found any solution to the problem
also because I used a threshold value different from the default

I found a bug in r.watershed SFD mode, fixed for 6.4 and 6.5 in
r54765-6 (7.0 was not affected). For r.basin, r.watershed could also
be run in MFD mode, the results might be a bit more accurate for
high-resolution DEMs.

Markus M

thank for your help

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5029421.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Thu, Jan 24, 2013 at 10:37 AM, Markus Metz <markus.metz.giswork@gmail.com> wrote:

On Thu, Jan 24, 2013 at 12:43 AM, Giuliano Urgeghe <giuliano.u@gmail.com> wrote:

I took your advice replacing lines 135-136 and 137 of the file, r.basin.py,
in the directory home/grass-addons/grass6/raster/r.basin by editor Kate
but I have not found any solution to the problem
also because I used a threshold value different from the default

I found a bug in r.watershed SFD mode, fixed for 6.4 and 6.5 in
r54765-6 (7.0 was not affected). For r.basin, r.watershed could also
be run in MFD mode, the results might be a bit more accurate for
high-resolution DEMs.

Thanks Markus, I’ll review it a bit according to your advices :wink:
m

Markus M

thank for your help


View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5029421.html
Sent from the Grass - Users mailing list archive at Nabble.com.


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

Margherita DI LEO
Postdoctoral Researcher

European Commission - DG JRC
Institute for Environment and Sustainability (IES). Unit H03 – FRC
Via Fermi, 2749
I-21027 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-leo@jrc.ec.europa.eu

Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission.

Sorry MarKus I found http://trac.osgeo.org/grass/changeset/54765 the bug
fixed.
How do I upgrade my installation of grass?

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5029693.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Sorry Marcus I found http://trac.osgeo.org/grass/changeset/54765 the bug
fixed.
How do I upgrade my installation of grass?

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5029694.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Fri, Jan 25, 2013 at 12:08 AM, Giuliano Urgeghe <giuliano.u@gmail.com> wrote:

Sorry Marcus I found http://trac.osgeo.org/grass/changeset/54765 the bug
fixed.
How do I upgrade my installation of grass?

You can either compile GRASS from source using latest svn [0] or you
can modify the r.basin.py script by removing r.watershed and adding
drainage direction output to r.stream.extract. The flow accumulation
raster is cropped later on in the script but otherwise not used, so
you can remove flow accumulation completely from the script.

Markus M

[0] http://grasswiki.osgeo.org/wiki/Compile_and_Install

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5029694.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Thank you Markus,
would you suggest following Ubuntu's compilation instructions with OS Mint
14 or OS KUbuntu?

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5029834.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Fri, Jan 25, 2013 at 11:53 AM, Giuliano Urgeghe <giuliano.u@gmail.com> wrote:

Thank you Markus,
would you suggest following Ubuntu's compilation instructions with OS Mint
14 or OS KUbuntu?

Since Mint is based on Ubuntu, the compile instructions for Ubuntu [0]
should work. Please let us know if they work or need modification.

[0] http://grasswiki.osgeo.org/wiki/Compile_and_Install#Ubuntu

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5029834.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

for now I try on Ubuntu 12.04.01 LTS
but I get this error
I just started with ubuntu

Trovato http://qgis.org precise/main Sources
Trovato http://qgis.org precise/main i386 Packages
Ign http://qgis.org precise/main Translation-it_IT
Ign http://qgis.org precise/main Translation-it
Ign http://qgis.org precise/main Translation-en
Recuperati 197 B in 4s (41 B/s)
Lettura elenco dei pacchetti... Fatto
*W: Errore GPG: http://qgis.org precise Release: Le seguenti firme non sono
state verificate perché la chiave pubblica non è disponibile: NO_PUBKEY
EBB1B7ED997D3880*
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze
Lettura informazioni sullo stato... Fatto
I seguenti pacchetti saranno aggiornati:
  grass
1 aggiornati, 0 installati, 0 da rimuovere e 0 non aggiornati.
È necessario scaricare 0 B/21,8 MB di archivi.
Dopo quest'operazione, verranno occupati 53,7 MB di spazio su disco.
Continuare [S/n]? s
(Lettura del database... 278279 file e directory attualmente installati.)
Preparativi per sostituire grass v.6.4.2~upstream2-3~precise4 (utilizzando
.../grass_6.4.3rc2-2~precise_i386.deb)...
Estrazione del sostituto di grass...
Sostituzione dei file nella versione precedente del pacchetto grass-core...
dpkg: errore nell'elaborare
/var/cache/apt/archives/grass_6.4.3rc2-2~precise_i386.deb (--unpack):
tentata sovrascrittura di "/usr/lib/grass64/bin/xganim" presente anche nel
pacchetto grass-gui 6.4.2~upstream2-3~precise4
dpkg-deb: errore: il sottoprocesso paste è stato terminato dal segnale (Pipe
interrotta)
Elaborazione dei trigger per man-db...
Si sono verificati degli errori nell'elaborazione:
/var/cache/apt/archives/grass_6.4.3rc2-2~precise_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5030043.html
Sent from the Grass - Users mailing list archive at Nabble.com.

I think I have solved the error accumulation map does not match with the
elevation map installing 6.4.3
but now I get this error:
Tue Jan 29 08:32:15 2013)
r.basin map=dem@PERMANENT prefix=LuLitarroni61 easting=1509351.753173
northing=4553749.816433 threshold=100
SECTION 1a (of 4): Initiating Memory.
SECTION 1b (of 4): Determining Offmap Flow.
SECTION 2: A * Search.
SECTION 3: Accumulating Surface Flow with SFD.
SECTION 4: Closing Maps.
WARNING: Writing out only positive flow accumulation values.
WARNING: Cells with a likely underestimate for flow accumulation can no
longer be identified.
Load input maps and get start points...
Set edge points...
A* Search...
Extract streams...
Thin stream segments...
Write raster maps
Reading maps...
Calculate basins using coordinates...
LuLitarroni61_dem_basin Done!
Delineation of basin done
Rename raster <tmp> to <LuLitarroni61_dem_accumulation>
Rename raster <tmp> to <LuLitarroni61_dem_drainage>
Rename raster <tmp> to <LuLitarroni61_dem_drainage_e>
Rename raster <tmp> to <LuLitarroni61_dem_stream_e>
File LuLitarroni61_dem_stream_e -- 2426 rows X 3003 columns
ERROR: (null): Unable to find bounding box for lines
ERROR: Raster map <LuLitarroni61_dem_stream_e_thin> not found
Aspect raster map <LuLitarroni61_dem_aspect> complete
Slope raster map <LuLitarroni61_dem_slope> complete
Extracting areas...
Building topology for vector map <LuLitarroni61_dem_basin>...
Registering primitives...
37 primitives registered
189 vertices registered
Building areas...
13 areas built
1 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 25
Number of primitives: 37
Number of points: 0
Number of lines: 0
Number of boundaries: 24
Number of centroids: 13
Number of areas: 13
Number of isles: 1
r.to.vect complete.
Reading areas...
Updating database...
1 categories read from vector map (layer 1)
1 records selected from table (layer 1)
1 categories read from vector map exist in selection from table
1 records updated/inserted (layer 1)
Reading areas...
1 categories read from vector map (layer 1)
0 records updated/inserted (layer 1)
Reading areas...
Updating database...
1 categories read from vector map (layer 1)
1 records selected from table (layer 1)
1 categories read from vector map exist in selection from table
1 records updated/inserted (layer 1)
Reading areas...
1 categories read from vector map (layer 1)
0 records updated/inserted (layer 1)
Creating LuLitarroni61_dem_hack
Reading maps...
ERROR: No streams found
Scanning input for column types...
Maximum input row length: 33
Maximum number of columns: 3
Minimum number of columns: 3
Column: 1 type: double
Column: 2 type: double
Column: 3 type: integer
Importing points...
Populating table...
Building topology for vector map <LuLitarroni61_dem_outlet>...
Registering primitives...
1 primitives registered
1 vertices registered
Building areas...
0 areas built
0 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 1
Number of primitives: 1
Number of points: 1
Number of lines: 0
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
v.in.ascii complete.
Loading data...
Reading features...
Writing raster map...
Converted points/lines: 1 of 1
v.to.rast complete.
Reading maps...
Finding nodes...
Calculate downstream distance
LuLitarroni61_dem_dist2out Done
##################################
Tot. cells 13.0

Ipsometric | quantiles

10 | 0.025
10 | 0.05
10 | 0.1
10 | 0.25
10 | 0.5
7 | 0.75
9 | 0.7
4 | 0.9
4 | 0.975
Done!
##################################
##################################
Tot. cells 13.0
Tot. area 1300.0
Max distance 169.372871

Whidth Function | quantiles

-131 | 0.05
-113 | 0.15
-86 | 0.3
-67 | 0.4
-49 | 0.5
-31 | 0.6
-12 | 0.7
15 | 0.85
33 | 0.95
Done!
##################################
Reading maps...
Finding nodes...
Calculate downstream distance
LuLitarroni61_dem_hillslope_distance Done
r.stats:
WARNING: Cats for raster map <r_elevation_crop@aglientu> are either missing
or have no explicit labels. Using nsteps=255.
r.recode:
r.recode complete. Raster map <LuLitarroni61_dem_height_average> created.
Dev note: Adapted sites library used for vector points. (module should be
updated to GRASS 6 vector library)
WARNING: Site/vector attributes ignored.
Complete ...
Invalid map <LuLitarroni61_dem_hack>
Parse error
ERROR: An error occurred while running r.mapcalc

##################################

An error occurred with the parameters calculation.
Please note that outlet coordinates must belong to the river network.
You might want to run r.stream.extract and choose coordinates matching with
the extracted stream map.
Please report to the authors any other problem not related with coordinates
outlet.
(Tue Jan 29 08:45:27 2013) Command finished (13 min 12 sec)

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5030492.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi,

r.thin fails, most likely because there’s nothing to thin. It is supposed to thin the stream network extracted by r.stream.extract, please take a look at the map produced. Most likely it will be empty, because the coordinates of the outlet don’t match to the stream.

HTH
madi

On Tue, Jan 29, 2013 at 8:45 AM, Giuliano Urgeghe <giuliano.u@gmail.com> wrote:

I think I have solved the error accumulation map does not match with the
elevation map installing 6.4.3
but now I get this error:
Tue Jan 29 08:32:15 2013)
r.basin map=dem@PERMANENT prefix=LuLitarroni61 easting=1509351.753173
northing=4553749.816433 threshold=100
SECTION 1a (of 4): Initiating Memory.
SECTION 1b (of 4): Determining Offmap Flow.
SECTION 2: A * Search.
SECTION 3: Accumulating Surface Flow with SFD.
SECTION 4: Closing Maps.
WARNING: Writing out only positive flow accumulation values.
WARNING: Cells with a likely underestimate for flow accumulation can no
longer be identified.
Load input maps and get start points…
Set edge points…
A* Search…
Extract streams…
Thin stream segments…
Write raster maps
Reading maps…
Calculate basins using coordinates…
LuLitarroni61_dem_basin Done!
Delineation of basin done
Rename raster to <LuLitarroni61_dem_accumulation>
Rename raster to <LuLitarroni61_dem_drainage>
Rename raster to <LuLitarroni61_dem_drainage_e>
Rename raster to <LuLitarroni61_dem_stream_e>
File LuLitarroni61_dem_stream_e – 2426 rows X 3003 columns
ERROR: (null): Unable to find bounding box for lines
ERROR: Raster map <LuLitarroni61_dem_stream_e_thin> not found
Aspect raster map <LuLitarroni61_dem_aspect> complete
Slope raster map <LuLitarroni61_dem_slope> complete
Extracting areas…
Building topology for vector map <LuLitarroni61_dem_basin>…
Registering primitives…
37 primitives registered
189 vertices registered
Building areas…
13 areas built
1 isles built
Attaching islands…
Attaching centroids…
Number of nodes: 25
Number of primitives: 37
Number of points: 0
Number of lines: 0
Number of boundaries: 24
Number of centroids: 13
Number of areas: 13
Number of isles: 1
r.to.vect complete.
Reading areas…
Updating database…
1 categories read from vector map (layer 1)
1 records selected from table (layer 1)
1 categories read from vector map exist in selection from table
1 records updated/inserted (layer 1)
Reading areas…
1 categories read from vector map (layer 1)
0 records updated/inserted (layer 1)
Reading areas…
Updating database…
1 categories read from vector map (layer 1)
1 records selected from table (layer 1)
1 categories read from vector map exist in selection from table
1 records updated/inserted (layer 1)
Reading areas…
1 categories read from vector map (layer 1)
0 records updated/inserted (layer 1)
Creating LuLitarroni61_dem_hack
Reading maps…
ERROR: No streams found
Scanning input for column types…
Maximum input row length: 33
Maximum number of columns: 3
Minimum number of columns: 3
Column: 1 type: double
Column: 2 type: double
Column: 3 type: integer
Importing points…
Populating table…
Building topology for vector map <LuLitarroni61_dem_outlet>…
Registering primitives…
1 primitives registered
1 vertices registered
Building areas…
0 areas built
0 isles built
Attaching islands…
Attaching centroids…
Number of nodes: 1
Number of primitives: 1
Number of points: 1
Number of lines: 0
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
v.in.ascii complete.
Loading data…
Reading features…
Writing raster map…
Converted points/lines: 1 of 1
v.to.rast complete.
Reading maps…
Finding nodes…
Calculate downstream distance
LuLitarroni61_dem_dist2out Done
##################################
Tot. cells 13.0

Ipsometric | quantiles

10 | 0.025
10 | 0.05
10 | 0.1
10 | 0.25
10 | 0.5
7 | 0.75
9 | 0.7
4 | 0.9
4 | 0.975
Done!
##################################
##################################
Tot. cells 13.0
Tot. area 1300.0
Max distance 169.372871

Whidth Function | quantiles

-131 | 0.05
-113 | 0.15
-86 | 0.3
-67 | 0.4
-49 | 0.5
-31 | 0.6
-12 | 0.7
15 | 0.85
33 | 0.95
Done!
##################################
Reading maps…
Finding nodes…
Calculate downstream distance
LuLitarroni61_dem_hillslope_distance Done
r.stats:
WARNING: Cats for raster map r_elevation_crop@aglientu are either missing
or have no explicit labels. Using nsteps=255.
r.recode:
r.recode complete. Raster map <LuLitarroni61_dem_height_average> created.
Dev note: Adapted sites library used for vector points. (module should be
updated to GRASS 6 vector library)
WARNING: Site/vector attributes ignored.
Complete …
Invalid map <LuLitarroni61_dem_hack>
Parse error
ERROR: An error occurred while running r.mapcalc

##################################

An error occurred with the parameters calculation.
Please note that outlet coordinates must belong to the river network.
You might want to run r.stream.extract and choose coordinates matching with
the extracted stream map.
Please report to the authors any other problem not related with coordinates
outlet.
(Tue Jan 29 08:45:27 2013) Command finished (13 min 12 sec)


View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5030492.html
Sent from the Grass - Users mailing list archive at Nabble.com.


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

Margherita DI LEO
Postdoctoral Researcher

European Commission - DG JRC
Institute for Environment and Sustainability (IES). Unit H03 – FRC
Via Fermi, 2749
I-21027 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-leo@jrc.ec.europa.eu

Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission.

I wanted to inform you that the error is upstream of r.thin because r.thin
works on a map that has this metadata:

Layer: LuLitarroni61_dem_stream_e@ag Date: Tue Jan 29 15:19:45 2013 |
| Mapset: aglientu Login of Creator: giuliano
|
| Location: 3003_sardegna_2hec
|
| DataBase: /home/giuliano/Scrivania/grass
|
| Title: ( tmp )
|
| Timestamp: none
|

|----------------------------------------------------------------------------|
|
|
| Type of Map: raster Number of Categories: 0
|
| Data Type: CELL
|
| Rows: 2426
|
| Columns: 3003
|
| Total Cells: 7285278
|
| Projection: Transverse Mercator
|
| N: 4561913.0845 S: 4537653.0845 Res: 10
|
| E: 1528979.264 W: 1498949.264 Res: 10
|
| Range of data: min = NULL max = NULL
|
|
|
| Data Description:
|
| generated by r.mapcalc
|
|
|
| Comments:
|
| LuLitarroni61_dem_stream_e * LuLitarroni61_dem_mask
|
|

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/error-accumulation-map-does-not-match-with-elevation-map-tp5029128p5030631.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi,

On Wed, Jan 23, 2013 at 3:18 PM, Markus Metz <markus.metz.giswork@gmail.com> wrote:

On Wed, Jan 23, 2013 at 1:21 PM, Helmut Kudrnovsky <hellik@web.de> wrote:

but when I launch r.basin in a closing section of the basin, I get the
error: “map of accumulations
does not match the map of elevations.”

r.basin is based upon r.stream.extract and other useful modules.

The bug is in r.basin which modifies the current region after
r.watershed is called and before r.stream.extract is called, if the
default threshold should be used. In this case, the region is set to
match the input elevation map in order to get the resolution (nsres
only by the way). The fix would be to replace in r.basin.py line 135 -
137
info_region = grass.read_command(‘g.region’, flags = ‘p’, rast
= ‘%s’ % (r_elevation))
dict_region = grass.parse_key_val(info_region, ‘:’)
resolution = float(dict_region[‘nsres’])
with
resolution = grass.region()[‘nsres’]

FYI, I applied this modification, and also switched from SFD to MFD algorithm in r.basin. I also updated the wiki page documentation accordingly.

Regards,
madi

Margherita DI LEO
Postdoctoral Researcher

European Commission - DG JRC
Institute for Environment and Sustainability (IES). Unit H03 – FRC
Via Fermi, 2749
I-21027 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-leo@jrc.ec.europa.eu

Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission.