[GRASS-user] GRASS GIS : r.mblend: Data base element error.
Luís Moreira de Sousa
luis.de.sousa at protonmail.ch
Fri Nov 3 02:45:32 PDT 2023
Hi Job,
looks like something is going wrong creating the attribute table for the interpolation points vector. This is made with v.db.connect at the time of the "Linking attribute table to layer 1" message. Which back-end are you using? The SQLite default? I would ask you to verify whether v.db.connect is working correctly on your system, you can create a new points vector and then test with v.db.select. Another experiment is trying a different back-end. For serious stuff I use Postgres.
If your data are cartographic (UTM) you should stick to the original CRS and not transform to a geographic system. It is also preferable if you use GRASS 8.
Regards.
--
Luís
Sent with [Proton Mail](https://proton.me/) secure email.
------- Original Message -------
On Thursday, November 2nd, 2023 at 5:12 AM, THOMAS JOB JOSE via grass-user <grass-user at lists.osgeo.org> wrote:
> I'm using r.mblend within GRASS GIS v7.8.8 on Windows as well as on GRASS GIS v8.2.1 on Linux , attempting to merge higher resolution raster files (30 m) with lower resolution (500m). Everything is running until the print out step "Dropping extra column from far edge" at which point I hit an error: "Database connection not defined for layer 1". I tried it both on Windows and Linux. I encountered the same error. I even changed the projections of the raster file from UTM to WGS, still it showed the errors.
>
> Below I have attached the Command Output :
>
> (Thu Nov 2 12:46:45 2023)
> r.mblend high=N15E073 at PERMANENT low=gebco_2023_UTM at PERMANENT
> output=blend
> [r.mblend] Resampling low resolution raster to higher resolution
> [r.mblend] Multiplying low resolution by zero
> [r.mblend] Multiplying high resolution by zero
> [r.mblend] Computing extent of low resolution
> Extracting areas...
> Writing areas...
> Building topology for vector map <tmp_189483 at PERMANENT>...
> Registering primitives...
> Building areas...
> Attaching islands...
> Attaching centroids...
> r.to.vect complete.
> [r.mblend] Computing extent of high resolution
> Extracting areas...
> Writing areas...
> Building topology for vector map <tmp_189484 at PERMANENT>...
> Registering primitives...
> Building areas...
> Attaching islands...
> Attaching centroids...
> r.to.vect complete.
> [r.mblend] Computing area to interpolate
> Copying vector features from <tmp_189483 at PERMANENT>...
> Copying vector features from <tmp_189484 at PERMANENT>...
> Snapping boundaries with 1e-08 ...
> Breaking lines...
> Removing duplicates...
> Cleaning boundaries at nodes...
> Merging lines...
> Attaching islands...
> Building areas...
> Attaching islands...
> Querying vector map <tmp_189483 at PERMANENT>...
> Querying vector map <tmp_189484 at PERMANENT>...
> Writing centroids...
> Copying results to final output map...
> Building topology for vector map <tmp_189485 at PERMANENT>...
> Registering primitives...
> Building areas...
> Attaching islands...
> Attaching centroids...
> v.overlay complete.
> [r.mblend] Computing buffer around interpolation area
> Buffering areas...
> Cleaning buffers...
> Building parts of topology...
> Building topology for vector map <tmp_189486 at PERMANENT>...
> Registering primitives...
> Snapping boundaries...
> Reading features...
> Snap vertices Pass 1: select points
> Snap vertices Pass 2: assign anchor vertices
> Snap vertices Pass 3: snap to assigned points
> Breaking polygons...
> Breaking polygons (pass 1: select break points)...
> Breaking polygons (pass 2: break at selected points)...
> Removing duplicates...
> Breaking boundaries...
> Removing duplicates...
> Cleaning boundaries at nodes
> Building topology for vector map <tmp_189486 at PERMANENT>...
> Building areas...
> Removing dangles...
> Removing bridges...
> Attaching islands...
> Building topology for vector map <tmp_189486 at PERMANENT>...
> Attaching islands...
> Calculating centroids for all areas...
> Generating list of boundaries to be deleted...
> Deleting boundaries...
> Calculating centroids for areas...
> Building topology for vector map <tmp_189486 at PERMANENT>...
> Registering primitives...
> Building areas...
> Attaching islands...
> Attaching centroids...
> [r.mblend] Vectorising differences between input rasters
> Reading areas...
> Writing raster map...
> 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...
> Building topology for vector map <tmp_189488 at PERMANENT>...
> Registering primitives...
> r.to.vect complete.
> Raster MASK removed
> [r.mblend] Computing distance to high resolution raster
> Reading raster map <N15E073 at PERMANENT>...
> Writing output raster maps...
> [r.mblend] Rescaling distance to [0,10000] interval
> Rescale tmp_189489[0,1453] to tmp_1894810[0,10000]
> [r.mblend] Extract points from interpolation area boundary
> Building topology for vector map <tmp_1894812 at PERMANENT>...
> Registering primitives...
> v.to.points complete. 207 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_1894811 at PERMANENT>...
> Registering primitives...
> v.category complete. 207 features modified.
> [r.mblend] Linking attribute table to layer 1
> The table <tmp_1894811> is now part of vector map <tmp_1894811> 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_1894811>. Creating...
> Reading features from vector map...
> Update vector attributes...
> v.what.rast complete. 207 records updated.
> [r.mblend] Selecting far edge points (using cut-off percentage)
> Extracting features...
> Building topology for vector map <tmp_1894816 at PERMANENT>...
> Registering primitives...
> Writing attributes...
> [r.mblend] Dropping extra column from far edge
> ERROR: Database connection not defined for layer 1
> Region:
> {'projection': 1, 'zone': 43, 'n': 1769980.79652272, 's': 1658549.10764584, 'w': 284498.79684178, 'e': 393033.65992938, 'nsres': 30.27212412, 'ewres': 30.27471774, 'rows': 3681, 'cols': 3585, 'cells': 13196385}
> Traceback (most recent call last):
> File "C:\Users\jobthomas97\AppData\Roaming\GRASS7\addons\s
> cripts\r.mblend.py", line 332, in <module>
> main()
> File "C:\Users\jobthomas97\AppData\Roaming\GRASS7\addons\s
> cripts\r.mblend.py", line 279, in main
> gscript.run_command(
> File "C:\Program Files\GRASS GIS
> 7.8\etc\python\grass\script\core.py", line 441, in
> run_command
> return handle_errors(returncode, returncode, args,
> kwargs)
> File "C:\Program Files\GRASS GIS
> 7.8\etc\python\grass\script\core.py", line 342, in
> handle_errors
> raise CalledModuleError(module=None, code=code,
> grass.exceptions.CalledModuleError: Module run None
> v.db.dropcolumn map=tmp_1894816 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_1894811> linked to vector map <tmp_1894811> does not exist
> (Thu Nov 2 12:47:06 2023) Command finished (20 sec)
>
> Regards,
> Job Thomas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20231103/65d40a4e/attachment-0001.htm>
More information about the grass-user
mailing list