2025-10-08T14:48:07 WARNING Traceback (most recent call last):
File "C:\Users/mayum/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus\QSWATPlus\hrus.py", line 5975, in getLanduseFile
QSWATUtils.openAndLoadFile(root, FileTypes._LANDUSES,
File "C:\Users/mayum/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus\QSWATPlus\QSWATUtils.py", line 879, in openAndLoadFile
layer = QSWATUtils.getLayerByFilename(root.findLayers(), outFileName, ft,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users/mayum/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus\QSWATPlus\QSWATUtils.py", line 684, in getLayerByFilename
layer = QSWATUtils.clipLayerToDEM(treeLayers, cast(QgsRasterLayer, layer), fileName, legend, gv)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users/mayum/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus\QSWATPlus\QSWATUtils.py", line 587, in clipLayerToDEM
assert os.path.exists(clipName), 'Failed to clip raster {0} to make {1}'.format(fileName, clipName)
^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Failed to clip raster C:/Users/mayum/Documents/working/qgis2/etowah\Watershed\Rasters\Landuse\nlcd_2024_saga.sdat to make C:/Users/mayum/Documents/working/qgis2/etowah\Watershed\Rasters\Landuse\nlcd_2024_saga_clip.tif
with this messages in Process window:
2025-10-08T14:48:07 INFO gdal_translate -a_nodata 250.0 -of GTiff -srcwin 16073 5469 -8864 -7 C:/Users/mayum/Documents/working/qgis2/etowah\Watershed\Rasters\Landuse\nlcd_2024_saga.sdat C:/Users/mayum/Documents/working/qgis2/etowah\Watershed\Rasters\Landuse\nlcd_2024_saga_clip.tif
2025-10-08T14:48:07 INFO GDAL command:
2025-10-08T14:48:07 INFO gdal_translate -a_nodata 250.0 -of GTiff -srcwin 16073 5469 -8864 -7 C:/Users/mayum/Documents/working/qgis2/etowah\Watershed\Rasters\Landuse\nlcd_2024_saga.sdat C:/Users/mayum/Documents/working/qgis2/etowah\Watershed\Rasters\Landuse\nlcd_2024_saga_clip.tif
2025-10-08T14:48:07 INFO GDAL command output:
2025-10-08T14:48:07 CRITICAL Process returned error code 1
2025-10-08T14:48:07 INFO Results: {'OUTPUT': 'C:/Users/mayum/Documents/working/qgis2/etowah\\Watershed\\Rasters\\Landuse\\nlcd_2024_saga_clip.tif'}
2025-10-08T14:48:07 CRITICAL ERROR 1: Error: -srcwin 16073 5469 -8864 -7 has negative width and/or height.
2025-10-08T14:48:07 INFO Input file size is 24888, 13703
Mayu:
You should post this on the SWAT+ and/or QSWAT+ Google group so the developer can review it.
Nancy
From: swat...@googlegroups.com <swat...@googlegroups.com>
On Behalf Of Mayu Mizutani
Sent: Wednesday, October 8, 2025 1:55 PM
To: SWAT-user <swat...@googlegroups.com>
Subject: [SWAT-user:13268] Python error when clipping land use rasters
You don't often get email from mayumiz...@gmail.com. Learn why this is important |
--
You received this message because you are subscribed to the Google Groups "SWAT-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
swatuser+u...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/swatuser/d3159cbf-7a9c-4f41-bb1d-2d4df514282cn%40googlegroups.com.