[GIS] QGIS Clipping Raster ERROR Cutline polygon is invalid
clipqgis
I want to clip a raster tif image based on a shapefile. However,the error as Fig.2 popuped when I use the Clipper Toolbox.What's the reason?I can make it in ArcGIS by Clip function in Toolbox.Thanks.
Fig.1
Fig.2
Best Answer
Obviously you are using a polygon which has a self intersection.
Check your geometries in QGIS with Vector > Geometry Tools > Check validity.
After trying around with everything I finally figured out how to solve the problem.
It had indeed to do with the CRS. Right click "Set CRS" was not enough here.
I had to perform (on the raster) Raster->Projections->Warp, then set the desired CRS again and save as Geotiff.
The mask layer (vector layer) had to be saved again with the same CRS.
After that the process worked.
Still weird, because I know, that in 1.7.4 it did work immediately. I can remember pretty well, because that was when I started with QGIS.
Similar problem right now (QGIS 2.6.1). But shapefile has some issues (topologic issues). I guess that shapefile has to be repaired before being used as crop mask.
Topological issues in shapefiles can be repaired using GRASS GIS. Here's a really simple guide of how to repair a bad polygon. You only need to know how to use GRASS GIS.
This guide help me resolve my problem with a polygon shapefile with topological errors. Then, cropping was as easy as usual using QGIS tool and gdal warp tool.
Best Answer
Obviously you are using a polygon which has a self intersection.
Check your geometries in QGIS with
Vector > Geometry Tools > Check validity
.