2

I'm receiving a Python Error when trying to create a web map using QGIS2Web and for the life of me cannot figure out what to do.

Running QGIS 3.6.3 Noosa Windows 10 Professional

KeyError: 100 
Traceback (most recent call last):
  File "C:/Users/Rodney/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\qgis2web.py", line 60, in run
    self.dlg = MainDialog(self.iface)
  File "C:/Users/Rodney/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\maindialog.py", line 156, in __init__
    self.autoUpdatePreview()
  File "C:/Users/Rodney/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\maindialog.py", line 320, in autoUpdatePreview
    self.previewMap()
  File "C:/Users/Rodney/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\maindialog.py", line 323, in previewMap
    preview_file = self.createPreview()
  File "C:/Users/Rodney/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\maindialog.py", line 286, in createPreview
    dest_folder=utils.tempFolder()).index_file
  File "C:/Users/Rodney/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\olwriter.py", line 91, in write
    folder=dest_folder)
  File "C:/Users/Rodney/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\olwriter.py", line 130, in writeOL
    popup, json, restrictToExtent, extent, feedback, matchCRS)
  File "C:/Users/Rodney/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\utils.py", line 220, in exportLayers
    iface, extent, precision, crs, optimize)
  File "C:/Users/Rodney/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\utils.py", line 233, in exportVector
    cleanLayer = writeTmpLayer(layer, restrictToExtent, iface, extent)
  File "C:/Users/Rodney/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\utils.py", line 162, in writeTmpLayer
    uri = TYPE_MAP[layer.wkbType()]
KeyError: 100

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] QGIS version: 3.6.3-Noosa Noosa, 0c5774c068

Python Path:

C:/PROGRA~1/QGIS 3.6/apps/qgis/./python
C:/Users/Rodney/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/Rodney/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS 3.6/apps/qgis/./python/plugins
C:\Program Files\QGIS 3.6\bin\python37.zip
C:\PROGRA~1\QGIS 3.6\apps\Python37\DLLs
C:\PROGRA~1\QGIS 3.6\apps\Python37\lib
C:\Program Files\QGIS 3.6\bin
C:\PROGRA~1\QGIS 3.6\apps\Python37
C:\PROGRA~1\QGIS 3.6\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS 3.6\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS 3.6\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS 3.6\apps\Python37\lib\site-packages\Pythonwin
C:/Users/Rodney/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\Rodney\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins
C:/Users/Rodney/Google Drive/QGis

1 Answer 1

2

The error message says that the key 100 is not found in this line uri = TYPE_MAP[layer.wkbType()]. So layer.wkbType() returns 100 which is the code for NoGeometry. So I guess you have a layer with no geometry set. If you can somehow disable or remove that layer it might work. Alternative try to update QGIS2Web. Looking at the source code you can see that an if statement handling layers with NoGeometry have been added 25 days ago: GitHub Blame (line 146)

1
  • Thanks, it did end up being a couple of layers with no geometry. Now i'm able to publish just fine. Commented Jun 14, 2019 at 13:10

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.