2

I'm using r.mblend within Grass GIS v7.6.1 on Windows, attempting to merge higher resolution raster files (1 m) with lower resolution (5m). All is running until the print out step "Dropping extra column from far edge" (see full printout below) at which point I hit an error: "Database connection not defined for layer 1"

In case it's important, the raster files used are imported using (i.e. they are not in the project's PERMANENT mapset):

r.in.gdal input="$i"  output=`basename "$i"`

Can I ensure that this database conenction is established prior to running the r.mblend step?

r.mblend is called as follows:

r.mblend high=EA_mosaic low=SP62_merge.tif output=multi_res_dtm_SP62

Traceback:

Region:
{u'rows': 2000, u'e': 470000.0, u'projection': 99, u'zone': 0, u'cells': 4000000, u'cols': 2000, u'n': 230000.0, u's': 220000.0, u'w': 460000.0, u'ewres': 5.0, u'nsres': 5.0}
[r.mblend] Resampling low resolution raster to higher resolution
 100%
[r.mblend] Multiplying low resolution by zero
 100%
[r.mblend] Multiplying high resolution by zero
 100%
[r.mblend] Computing extent of low resolution
Extracting areas...
 100%
Writing areas...
 100%
Building topology for vector map <tmp_294763@PERMANENT>...
Registering primitives...
Building areas...
 100%
Attaching islands...
 100%
Attaching centroids...
 100%
r.to.vect complete.
[r.mblend] Computing extent of high resolution
Extracting areas...
 100%
Writing areas...
 100%
Building topology for vector map <tmp_294764@PERMANENT>...
Registering primitives...
Building areas...
 100%
Attaching islands...
 100%
Attaching centroids...
 100%
r.to.vect complete.
[r.mblend] Computing area to interpolate
Copying vector features from <tmp_294763@PERMANENT>...
 100%
Copying vector features from <tmp_294764@PERMANENT>...
 100%
Snapping boundaries with 1e-008 ...
Breaking lines...
 100%
Removing duplicates...
 100%
Cleaning boundaries at nodes...
 100%
Merging lines...
 100%
Attaching islands...
Building areas...
Attaching islands...
 100%
Querying vector map <tmp_294763@PERMANENT>...
 100%
Querying vector map <tmp_294764@PERMANENT>...
 100%
Writing centroids...
 100%
Copying results to final output map...
 100%
Building topology for vector map <tmp_294765@PERMANENT>...
Registering primitives...
Building areas...
 100%
Attaching islands...
 100%
Attaching centroids...
 100%
v.overlay complete.
 100%
[r.mblend] Computing buffer around interpolation area
Buffering areas...
 100%
Cleaning buffers...
Building parts of topology...
Building topology for vector map <tmp_294766@PERMANENT>...
Registering primitives...
Snapping boundaries...
Reading features...
Snap vertices Pass 1: select points
 100%
Snap vertices Pass 2: assign anchor vertices
 100%
Snap vertices Pass 3: snap to assigned points
 100%
Breaking polygons...
Breaking polygons (pass 1: select break points)...
 100%
Breaking polygons (pass 2: break at selected points)...
 100%
Removing duplicates...
 100%
Breaking boundaries...
 100%
Removing duplicates...
 100%
Cleaning boundaries at nodes
 100%
Building topology for vector map <tmp_294766@PERMANENT>...
Building areas...
 100%
Removing dangles...
 100%
Removing bridges...
 100%
Attaching islands...
Building topology for vector map <tmp_294766@PERMANENT>...
Attaching islands...
 100%
Calculating centroids for all areas...
 100%
Generating list of boundaries to be deleted...
 100%
Deleting boundaries...
 100%
Calculating centroids for areas...
 100%
Building topology for vector map <tmp_294766@PERMANENT>...
Registering primitives...
Building areas...
 100%
Attaching islands...
 100%
Attaching centroids...
 100%
[r.mblend] Vectorising differences between input rasters
Reading areas...
 100%
Writing raster map...
 100%
All subsequent raster operations will be limited to the MASK area. Removing
or renaming raster map named 'MASK' will restore raster operations to
normal.
Extracting points...
 100%
Building topology for vector map <tmp_294768@PERMANENT>...
Registering primitives...
r.to.vect complete.
Raster MASK removed
[r.mblend] Computing distance to high resolution raster
Reading raster map <EA_mosaic>...
 100%
Writing output raster maps...
 100%
[r.mblend] Rescaling distance to [0,10000] interval
Rescale tmp_294769[0,5881] to tmp_2947610[0,10000]
[r.mblend] Extract points from interpolation area boundary
 100%
Building topology for vector map <tmp_2947612@PERMANENT>...
Registering primitives...
v.to.points complete. 300 points written to output vector map.
[r.mblend] Copying features to layer 1
WARNING: Database connection and attribute tables for concerned layers are
         not changed
Processing features...
Copying attribute table(s)...
Building topology for vector map <tmp_2947611@PERMANENT>...
Registering primitives...
v.category complete. 300 features modified.
[r.mblend] Linking attribute table to layer 1
The table <tmp_2947611> is now part of vector map <tmp_2947611> and may be
deleted or overwritten by GRASS modules
Select privileges were granted on the table
[r.mblend] Querying distances raster
Column <value> not found in the table <tmp_2947611>. Creating...
Reading features from vector map...
Update vector attributes...
 100%
v.what.rast complete. 188 records updated.
[r.mblend] Selecting far edge points (using cut-off percentage)
Extracting features...
 100%
Building topology for vector map <tmp_2947616@PERMANENT>...
Registering primitives...
Writing attributes...
[r.mblend] Dropping extra column from far edge
ERROR: Database connection not defined for layer 1
Traceback (most recent call last):
  File "C:\Users\chrwil\AppData\Roaming\GRASS7\addons/scripts/r.mblend.py", line 282, in <module>
    main()
  File "C:\Users\chrwil\AppData\Roaming\GRASS7\addons/scripts/r.mblend.py", line 241, in main
    columns='along')
  File "C:\Program Files\GRASS GIS 7.6\etc\python\grass\script\core.py", line 423, in run_command
    return handle_errors(returncode, returncode, args, kwargs)
  File "C:\Program Files\GRASS GIS 7.6\etc\python\grass\script\core.py", line 334, in handle_errors
    returncode=returncode)
grass.exceptions.CalledModuleError: Module run None ['v.db.dropcolumn', 'map=tmp_2947616', 'layer=1', 'columns=along'] ended with error
Process ended with non-zero return code 1. See errors in the (error) output.
WARNING: No data base element files found
WARNING: No data base element files found
WARNING: No data base element files found
WARNING: No data base element files found
WARNING: Table <tmp_2947611> linked to vector map <tmp_2947611> does not
         exist

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.