1

I've been able to use the vector to 3d tool successfully on some contour information before, but it's throwing an error anytime I work with data from New Hampshire's Granit site. In QGIS, the tool is processing contours that were clipped from a larger source, but the same error occurs with the original source.

The contour file was downloaded from this site. Error log is below.

QGIS version: 3.14.16-Pi
QGIS code revision: df27394552
Qt version: 5.11.2
GDAL version: 3.0.4
GEOS version: 3.8.1-CAPI-1.13.3
PROJ version: Rel. 6.3.2, May 1st, 2020
Processing algorithm…
Algorithm 'v.to.3d' starting…
Input parameters:
{ '-r' : False, '-t' : False, 'GRASS_MIN_AREA_PARAMETER' : 0.0001, 'GRASS_OUTPUT_TYPE_PARAMETER' : 0, 'GRASS_REGION_PARAMETER' : None, 'GRASS_SNAP_TOLERANCE_PARAMETER' : -1, 'GRASS_VECTOR_DSCO' : '', 'GRASS_VECTOR_EXPORT_NOCAT' : False, 'GRASS_VECTOR_LCO' : '', 'column' : 'Contour', 'height' : None, 'input' : 'H:/Projects/1076 Davis Hill Rd/GIS/QGIS/clipped_contours.gpkg', 'output' : 'H:/Projects/1076 Davis Hill Rd/GIS/QGIS/3d_contours.shp', 'type' : [0,1,2,3] }

g.proj -c proj4="+proj=tmerc +lat_0=42.5 +lon_0=-71.6666666666667 +k=0.999966667 +x_0=300000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs"
v.in.ogr min_area=0.0001 snap=-1.0 input="H:\Projects\1076 Davis Hill Rd\GIS\QGIS\clipped_contours.gpkg" output="vector_5fb6955ad4ece2" --overwrite -o
g.region n=535960.996313209 s=534763.830085938 e=1155883.30785149 w=1153276.4591556
v.to.3d input=vector_5fb6955ad4ece2 type="point,line,boundary,centroid" column=Contour output=outputa1606e472aa14d148dc8c5f860f34d52 --overwrite
v.out.ogr type="auto" input="outputa1606e472aa14d148dc8c5f860f34d52" output="H:\Projects\1076 Davis Hill Rd\GIS\QGIS\3d_contours.shp" format="ESRI_Shapefile" --overwrite
Starting GRASS GIS...
WARNING: Concurrent mapset locking is not supported on Windows
Cleaning up temporary files...
Executing <C:\Users\dylan.brown\AppData\Local\Temp\processing_YIrTJn\grassdata\grass_batch_job.cmd> ...
C:\Users\dylan.brown\Documents>chcp 1252 1>NUL
C:\Users\dylan.brown\Documents>g.proj -c proj4="+proj=tmerc +lat_0=42.5 +lon_0=-71.6666666666667 +k=0.999966667 +x_0=300000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs"
WARNING: Datum <Unknown_based_on_GRS80_ellipsoid> not recognised by GRASS and no parameters found
Default region was updated to the new projection, but if you have multiple mapsets `g.region -d` should be run in each to update the region from the default
Projection information updated
C:\Users\dylan.brown\Documents>v.in.ogr min_area=0.0001 snap=-1.0 input="H:\Projects\1076 Davis Hill Rd\GIS\QGIS\clipped_contours.gpkg" output="vector_5fb6955ad4ece2" --overwrite -o
Over-riding projection check
Check if OGR layer <clipped_contours> contains polygons...
0..2..4..6..8..10..12..14..16..18..20..22..24..26..28..30..32..34..36..38..40..42..44..46..48..50..52..54..56..58..60..62..64..66..68..70..72..74..76..78..80..82..84..86..88..90..92..94..96..98..100
Creating attribute table for layer <clipped_contours>...
ERROR: Unable to create table: 'create table vector_5fb6955ad4ece2 (cat integer, OBJECTID integer, Id integer, Contour double precision, INDEX integer, Shape_Length double precision)'
C:\Users\dylan.brown\Documents>g.region n=535960.996313209 s=534763.830085938 e=1155883.30785149 w=1153276.4591556
C:\Users\dylan.brown\Documents>v.to.3d input=vector_5fb6955ad4ece2 type="point,line,boundary,centroid" column=Contour output=outputa1606e472aa14d148dc8c5f860f34d52 --overwrite
WARNING: Coor file of vector map <vector_5fb6955ad4ece2@PERMANENT> is larger than it should be (18 bytes excess)
ERROR: Column <Contour> not found in table <vector_5fb6955ad4ece2>
WARNING: Unable to delete file 'C:\Users\dylan.brown\AppData\Local\Temp\processing_YIrTJn\grassdata\temp_location\PERMANENT\vector/outputa1606e472aa14d148dc8c5f860f34d52/coor'
C:\Users\dylan.brown\Documents>v.out.ogr type="auto" input="outputa1606e472aa14d148dc8c5f860f34d52" output="H:\Projects\1076 Davis Hill Rd\GIS\QGIS\3d_contours.shp" format="ESRI_Shapefile" --overwrite
WARNING: Unable to open vector map <outputa1606e472aa14d148dc8c5f860f34d52@PERMANENT> on level 2. Try to rebuild vector topology with v.build.
ERROR: Unable to open vector map <outputa1606e472aa14d148dc8c5f860f34d52>
C:\Users\dylan.brown\Documents>exit
Execution of <C:\Users\dylan.brown\AppData\Local\Temp\processing_YIrTJn\grassdata\grass_batch_job.cmd> finished.
Cleaning up default sqlite database ...
Cleaning up temporary files...
Press any key to continue . . .
Execution completed in 2.58 seconds
Results:
{'output': 'H:\\Projects\\1076 Davis Hill Rd\\GIS\\QGIS\\3d_contours.shp'}

Loading resulting layers
The following layers were not correctly generated.
• H:/Projects/1076 Davis Hill Rd/GIS/QGIS/3d_contours.shp
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

Log Messages Plugins

2020-11-19T11:17:22     INFO    Loaded DB Manager (package: db_manager)
2020-11-19T11:17:23     INFO    Loaded MetaSearch Catalog Client (package: MetaSearch)
2020-11-19T11:17:27     INFO    Loaded Processing (package: processing)

Python Warning

2020-11-19T11:17:23     WARNING    warning:C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py:792: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
              mod = _builtin_import(name, globals, locals, fromlist, level)
             
             traceback: File "", line 1, in 
              File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 302, in loadPlugin
              __import__(packageName)
              File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 792, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python/plugins\processing\__init__.py", line 26, in 
              from processing.tools.general import * # NOQA
              File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 792, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python/plugins\processing\tools\general.py", line 32, in 
              from processing.core.Processing import Processing
              File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 792, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python/plugins\processing\core\Processing.py", line 56, in 
              from processing.algs.qgis.QgisAlgorithmProvider import QgisAlgorithmProvider # NOQA
              File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 792, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python/plugins\processing\algs\qgis\QgisAlgorithmProvider.py", line 51, in 
              from .HypsometricCurves import HypsometricCurves
              File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 792, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python/plugins\processing\algs\qgis\HypsometricCurves.py", line 27, in 
              from osgeo import gdal, ogr, osr
              File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 792, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\osgeo\__init__.py", line 41, in 
              _gdal = swig_import_helper()
              File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\osgeo\__init__.py", line 15, in swig_import_helper
              import imp
              File "C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python\qgis\utils.py", line 792, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "", line 983, in _find_and_load
              File "", line 967, in _find_and_load_unlocked
              File "", line 677, in _load_unlocked
              File "", line 728, in exec_module
              File "", line 219, in _call_with_frames_removed
              File "C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\imp.py", line 33, in 
              DeprecationWarning, stacklevel=2)

General

2020-11-19T11:17:27     INFO    Application state:
             QGIS_PREFIX_PATH env var: C:/PROGRA~1/QGIS3~1.14/apps/qgis
             Prefix: C:/PROGRA~1/QGIS3~1.14/apps/qgis
             Plugin Path: C:/PROGRA~1/QGIS3~1.14/apps/qgis/plugins
             Package Data Path: C:/PROGRA~1/QGIS3~1.14/apps/qgis/.
             Active Theme Name: default
             Active Theme Path: C:/PROGRA~1/QGIS3~1.14/apps/qgis/./resources/themes\default\icons/
             Default Theme Path: :/images/themes/default/
             SVG Search Paths: C:/OSGEO4~1/apps/qgis/./svg/
              C:/Users/dylan.brown/AppData/Roaming/QGIS/QGIS3\profiles\default/svg/
              C:/PROGRA~1/QGIS3~1.14/apps/qgis/./svg/
             User DB Path: C:/PROGRA~1/QGIS3~1.14/apps/qgis/./resources/qgis.db
             Auth DB Path: C:/Users/dylan.brown/AppData/Roaming/QGIS/QGIS3\profiles\default/qgis-auth.db

Grass

2020-11-19T11:17:58     INFO    processInputs end. Commands: ['g.proj -c proj4="+proj=tmerc +lat_0=42.5 +lon_0=-71.6666666666667 +k=0.999966667 +x_0=300000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs"', 'v.in.ogr min_area=0.0001 snap=-1.0 input="H:\\Projects\\1076 Davis Hill Rd\\GIS\\QGIS\\clipped_contours.gpkg" output="vector_5fb69ab676c552" --overwrite -o', 'g.region n=535960.996313209 s=534763.830085938 e=1155883.30785149 w=1153276.4591556']
2020-11-19T11:17:58     INFO    processCommands end. Commands: ['g.proj -c proj4="+proj=tmerc +lat_0=42.5 +lon_0=-71.6666666666667 +k=0.999966667 +x_0=300000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs"', 'v.in.ogr min_area=0.0001 snap=-1.0 input="H:\\Projects\\1076 Davis Hill Rd\\GIS\\QGIS\\clipped_contours.gpkg" output="vector_5fb69ab676c552" --overwrite -o', 'g.region n=535960.996313209 s=534763.830085938 e=1155883.30785149 w=1153276.4591556', 'v.to.3d input=vector_5fb69ab676c552 type="point,line,boundary,centroid" column=Contour output=output16a56bda1ca644b18912e586081cb353 --overwrite']
2
  • Any additional info in the Log Messages Panel?
    – Erik
    Commented Nov 19, 2020 at 16:10
  • 1
    I just added more log info at the end of the post. Commented Nov 19, 2020 at 16:22

1 Answer 1

3

Your problem is here:

ERROR: Unable to create table: 'create table vector_5fb6955ad4ece2 (cat integer, OBJECTID integer, Id integer, Contour double precision, INDEX integer, Shape_Length double precision)'

It cannot create the table because of the field named 'INDEX', which is an SQL reserved word (see comment on this answer and here for a list of reserved words). Delete that field and it will run.

1
  • Thanks, that did it. For some reason it didn't work on the first four attempts, but after that, the command was able to process the contours. Commented Nov 30, 2020 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.