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
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.
[...]
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
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.
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
m
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.
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.
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)
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
-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)
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.
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
-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)
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.
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
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.