About the DEM input problem

47 views
Skip to first unread message

riad arefin

unread,
Oct 10, 2025, 3:13:27 AM10/10/25
to SWAT-MODFLOW
Hi,

I am trying to upload DEM in the QSWAT-MODFLOW but the following error is appearing:

An error has occurred while executing Python code:

AttributeError: 'NoneType' object has no attribute 'insertChildNode' Traceback (most recent call last):
  File "C:\Users/riadg/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\dialogs\createMFmodel_dialog.py", line 213, in loadDEM
    geovar_path = writeMF.load_geovar_raster(self, geovar='top_elev')
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users/riadg/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\pyfolder\writeMF.py", line 404, in load_geovar_raster
    mf_group.insertChildNode(0, QgsLayerTreeLayer(layer))
    ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'insertChildNode'


Python version: 3.12.11 (main, Jun 17 2025, 13:41:12) [MSC v.1943 64 bit (AMD64)]
QGIS version: 3.44.3-Solothurn Solothurn, 1d1d67e9edd

Python Path:
  • C:/PROGRA~1/QGIS34~1.3/apps/qgis/./python
  • C:/Users/riadg/AppData/Roaming/QGIS/QGIS3\profiles\default/python
  • C:/Users/riadg/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
  • C:/PROGRA~1/QGIS34~1.3/apps/qgis/./python/plugins
  • C:\PROGRA~1\QGIS34~1.3\apps\grass\grass84\etc\python
  • C:\Users\riadg\Documents
  • C:\Program Files\QGIS 3.44.3\bin\python312.zip
  • C:\PROGRA~1\QGIS34~1.3\apps\Python312\DLLs
  • C:\PROGRA~1\QGIS34~1.3\apps\Python312\Lib
  • C:\Program Files\QGIS 3.44.3\bin
  • C:\PROGRA~1\QGIS34~1.3\apps\Python312
  • C:\PROGRA~1\QGIS34~1.3\apps\Python312\Lib\site-packages
  • C:\PROGRA~1\QGIS34~1.3\apps\Python312\Lib\site-packages\win32
  • C:\PROGRA~1\QGIS34~1.3\apps\Python312\Lib\site-packages\win32\lib
  • C:\PROGRA~1\QGIS34~1.3\apps\Python312\Lib\site-packages\Pythonwin
  • C:/Users/riadg/AppData/Roaming/QGIS/QGIS3\profiles\default/python
  • C:\Users/riadg/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWAT\QSWAT
  • C:\PROGRA~1\QGIS34~1.3\apps\Python312\Lib\site-packages\setuptools\_vendor
  • C:/bald10_07-2025/MODFLOW
How I can solve this?

Thanks
Riad

Seonggyu Park

unread,
Dec 16, 2025, 10:24:38 PM12/16/25
to SWAT-MODFLOW
Hi Riad,

Are you trying to upload a TIFF file for the DEM? It should work with a TIFF file. If the issue persists, please share your QSWATMOD project folder and GIS file.
I'll take a look and get back to you.

Thanks,
Seonggyu

riad arefin

unread,
Jan 5, 2026, 3:51:34 PM (6 days ago) Jan 5
to SWAT-MODFLOW
Dear  Seonggyu,

Thank you.

The problem was opening of the DEM file in multiple platforms; it has fixed afterward. 

However, when I am trying to work with the example file. After importing QSwat files to QSWATMOD2 it was creating problem to generate simple Modflow model using option 3 like river shapefile generation, it is generating but not working. I was checked group discussion and worked accordingly like projection, and file headers name, here, everything was correct as like files and fields generated in SWAT-Modflow. Is it code related problem to get solution? Then it is difficult for me because I do not know code very well!! but if it be related fixing raster or file arrangement then I can fix this issue. 

As it is not working and I have limited time in my hand for my research work, therefore I have started developing a multilayer model using, Model Muse using Modflow 2005, in this case I have 5 layers: Aquitard, Aquifer, Aquitard, Aquifer, Aquitard. In QSWAT-Modflow-NWT GUI, is it possible to import Modflow 2005 model developed using Model Muse for coupling with SWAT?

Regards
Riad

Reply all
Reply to author
Forward
0 new messages