Sunday, 9 October 2016

qgis - Unable To Clean Incorrect Geometries with Grass?



Software:


QGIS 2.18.10


GRASS GIS 7.2.1


GitHub Repository Link: Police






Having difficulty fixing incorrect geometries for nypolicew84.zip shapefile (check GitHub link)


Errors when using GRASS to fix issue. Is there anything I am missing? Or is there a more straight-forward way to fix shapefile. Please assist.


QGIS file also in GitHub


Below are the steps:



1. Open Topology Checker


enter image description here


2. Click on Configuration


enter image description here


3. Select must not have invalid geometries


enter image description here


4. Rule gets added


enter image description here


5. Click on Validate All


enter image description here



6. Error Found


enter image description here


7. Zoom in to see all errors


enter image description here


8. Open GRASS GIS and set location


enter image description here


9. Follow prompts to set location. Kept at default


enter image description here


10. Keep EPSG


enter image description here



11. Select EPSG 4326


enter image description here


12. Get Unlabeled Error


enter image description here


13. Finish is grayed out


enter image description here



Answer



I had a look at your project and found a couple of polygon errors, using Check Validity tool (in Processing, under QGIS Geoalgorithms). That gives more detailed error messages than topology checker plugin . It also splits your layer into valid and invalid geometries.


The Topology Checker plugin checks a lot of things, but doesn't appear to give a more detailed reason WHY a geometry is invalid.


Looking at the "Invalid output" layer, two of the precincts have the following errors:-



Ring 0 has less than 4 points

You might want to try running v.clean (from Processing, rather than the GRASS GUI). I tend to use processing when I can, as it handles a lot of the setup (projections, regions) for you.


After running v.clean with default settings, then running topology checker on the output, the geometries show up as clean.


Edit


After running this fix the Duplicate ... errors by going to Vector - Geometry tools - Singleparts to multipart


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...