1

I just want to clip the raster by vector layer for the specific area, however I get this error after running. How to fix this?

QGIS version: 3.28.15-Firenze
QGIS code revision: 252ad49ddc
Qt version: 5.15.3
Python version: 3.9.18
GDAL version: 3.8.3
GEOS version: 3.12.1-CAPI-1.18.1
PROJ version: Rel. 9.3.1, December 1st, 2023
PDAL version: 2.6.0 (git-version: 3fced5)
Algorithm started at: 2024-03-19T21:42:44
Algorithm 'Clip raster by mask layer' starting…
Input parameters:
{ 'ALPHA_BAND' : False, 'CROP_TO_CUTLINE' : True, 'DATA_TYPE' : 0, 'EXTRA' : '', 'INPUT' : 'C:/Users/kirkw/Documents/THESIS/qgis/MRW_DEM.tif', 'KEEP_RESOLUTION' : False, 'MASK' : 'C:/Users/kirkw/Documents/THESIS/qgis/Elevation/sw5.shp', 'MULTITHREADING' : False, 'NODATA' : None, 'OPTIONS' : '', 'OUTPUT' : 'C:/Users/kirkw/Documents/THESIS/qgis/Elevation/SW5.tif', 'SET_RESOLUTION' : False, 'SOURCE_CRS' : QgsCoordinateReferenceSystem('EPSG:32651'), 'TARGET_CRS' : QgsCoordinateReferenceSystem('EPSG:32651'), 'TARGET_EXTENT' : None, 'X_RESOLUTION' : None, 'Y_RESOLUTION' : None }

GDAL command:

gdalwarp -overwrite -s_srs EPSG:32651 -t_srs EPSG:32651 -of GTiff -cutline C:/Users/kirkw/Documents/THESIS/qgis/Elevation/sw5.shp -cl sw5 -crop_to_cutline C:/Users/kirkw/Documents/THESIS/qgis/MRW_DEM.tif C:/Users/kirkw/Documents/THESIS/qgis/Elevation/SW5.tif
GDAL command output:
Warning 1: Ring Self-intersection at or near point 782127.5 784972.5
ERROR 1: Cutline polygon is invalid.
Process returned error code 1
Execution completed in 0.19 seconds
Results:
{'OUTPUT': 'C:/Users/kirkw/Documents/THESIS/qgis/Elevation/SW5.tif'}

Loading resulting layers
The following layers were not correctly generated.
• C:/Users/kirkw/Documents/THESIS/qgis/Elevation/SW5.tif
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

1 Answer 1

0

Your polygon is invalid as it has a self intersection. First you need to clean your geometry layer. From processing tools select Vector Geometry > Fix Geometries and Run. This will create a new layer after fixing the geometry errors.

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.