3

I wish to cut a vector layer with another layer (single polygon). I have tried both QGIS and GDAL cut geoprocessing with little satisfaction.

Input layer:

The input layer

Output layer (with cutting polyon in thick black border): The output

See the blank space that should be green.

Same operation using ArcGIS gives correct result. (Sorry I cannot paste screenshot here cause I lack reputation... you'll have to believe me)

Output message says one or more geometry invalid or TopologyException: Input geom 0 is invalid: Self-intersection at or near point.

Any idea how to tackle this?

1
  • GDAL or probably GEOS under the hood requires valid geometries without self-interacting polygons. Fix the source geometry first. If you use GDAL you can have a try with the SQLite SQL dialect and ST_MakeValid.
    – user30184
    Aug 28, 2017 at 13:38

1 Answer 1

5

QGIS can be a bit picky about running processing tools on features with invalid geometries, much more so than ArcGIS in my experience.

Run the topology checker in QGIS and see if your input shapefile has any topology errors (I suspect it does). If yes then you can repair them in various ways - answer from an original here: Solving topological errors in QGIS?

The most successful way I've ever had of correcting topological errors in Q is actually to use GRASS. You can either:

  1. run v.clean from the processing toolbox (manual here https://grass.osgeo.org/grass73/manuals/v.clean.html);

  2. use the 'Repair Geometry' plugin (which is an automation of the v.clean tool); or if all else fails

  3. import the dataset into GRASS proper and then export it out again as whatever format you want

I've never had number 3 fail for me and there is a good walkthrough of how to do it here: https://faunaliagis.wordpress.com/2013/08/14/bad-bad-polygon-fixing-invalid-geometries-with-quantum-gis/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.