Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
podcast
Filter by Categories
ArcGIS Pro
GDAL
GeoJson
Map
Map Tools
Maps
postgis
Python
QGIS
Uncategorized

How to Validate & Fix Geometry in QGIS

Step 1: Identify the Geometry Issue

Start by recognizing that you may encounter invalid geometry when working with spatial data in QGIS. For example, if you’re trying to clip polygons, you might receive an invalid geometry message. This indicates that there are issues with the geometry that need to be addressed.

Invalid geometry message in QGIS

Step 2: Use the Check Validity Tool

The first step to resolving geometry issues is to use the “Check Validity” tool in QGIS. You can find this tool in the toolbox, which is represented by a cogwheel icon. Once you locate the tool, select the layer you want to check for validity.

Check Validity tool in QGIS

Step 3: Analyze the Output

After running the Check Validity tool, you’ll receive an output detailing valid and invalid geometries. Pay attention to the error counter, which will indicate how many invalid geometries were found. This output will help you understand the nature of the geometry issues.

Output of Check Validity tool showing valid and invalid geometries

Step 4: Examine Invalid Features

Next, you can click on the invalid output to examine the specific features causing issues. Open the attribute table to identify the type of geometry error, such as a “ring self-intersection.” This information will guide you in fixing the geometry.

Attribute table showing invalid geometry features

Step 5: Fix the Geometry

To resolve the identified issues, use the “Fix Geometries” tool. Select the layer with invalid geometries and run the tool, outputting the results to memory. This process will attempt to correct the geometry errors automatically.

Fix Geometries tool in QGIS

Step 6: Verify the Fix

After using the Fix Geometries tool, it’s essential to verify that the issues have been resolved. Run the Check Validity tool again on the newly created layer. Ideally, the output should show that all geometries are now valid.

Output showing fixed geometries with no errors

Step 7: Additional Tools for Geometry Issues

If you encounter shapefile-specific issues, consider using the “Repair Shapefile” tool. This tool can recreate missing or corrupted index files (SHX files) that may cause errors in your shapefiles.

Repair Shapefile tool in QGIS

Conclusion

By following these steps, you can effectively validate and fix geometry issues in QGIS. Utilizing the Check Validity and Fix Geometries tools will enhance the quality of your spatial data and ensure smooth processing in your GIS projects.

About the Author
I'm Daniel O'Donohue, the voice and creator behind The MapScaping Podcast ( A podcast for the geospatial community ). With a professional background as a geospatial specialist, I've spent years harnessing the power of spatial to unravel the complexities of our world, one layer at a time.