Is there a simple way (could be hard as well) to find geometry (polygons) anomalies. For example polygon should be nice rectangle, but doesn't always look so (like in example). I am talking about more than 100 000k objects and somehow I need to find all anomalies.
-
Have you looked at the Check Geometry tool? It may not help for your example but other anomalies will show up.– PolyGeo ♦Jan 17, 2020 at 6:18
-
I've tried check geometry on this exact example, but it showed nothing.– DariusJan 17, 2020 at 6:22
-
1The time to detect this is during creation, not afterward. Please Edit the Question to specify how is the layer being created.– VinceJan 17, 2020 at 12:58
-
If you run the multipart to singlepart tool, recalculate an area field and then look for abnormally small polygons you should be able to catch many of those in your diagram. The check geometry tool may help too. Even though I often use ArcGIS for edits or creating datasets, I like to run the multipart to singlepart, check validity and topology checks in QGIS which creates in-memory layers which I can use to either fix things directly (they show you valid and invalid polygons) or to point me to manual fixes in the original.– JohnJan 17, 2020 at 13:17
-
1I believe the reason why this does not show up on check geometry is because it has valid topology. If you edit this geometry and look at its vertices its probably in 3 parts, which in themselves do not overlap, hence checks out OK. Exploding them into single parts is the way to identify such polygons. Earlier versions of GIS and some open source libraries almost certainly do not enforce this topological correctness. .– HornbyddOct 29, 2020 at 16:29
2 Answers
As it stands I think your question may be too broad for focussed Q&A because it seeks techniques for identifying multiple anomalies in your data.
If you want to identify any polygons in your data which are not "nice rectangles" the technique I would use is to write an ArcPy script using a cursor and the @SHAPE token to examine each polygon geometry to:
- Count the number of parts and rings
- When there is only one part and ring count the number of vertices
- When there are five vertices (the last to close the polygon back in itself) create a list of lengths for all four segments, applying whatever rounding rule you think is appropriate, and calculating a set of unique list values.
- When there are two unique segment lengths calculate the angles between each adjacent pair of segments
- If the angle between each pair of segments is close enough to 90 degrees (for your purposes) then you have a rectangle, unless two of your vertices are coincident (within your tolerance).
-
Well, iam really new to all this GIS thing. And python for me is far far space. :( But count by vertices would probably work– DariusJan 17, 2020 at 8:00
Have you tried Geo-processing tool in ArcGIS https://pro.arcgis.com/en/pro-app/tool-reference/data-management/check-geometry.htm
This checks any errors or invalid geometries in the dataset and reports into a file.
Hope you are looking for this.
Let me know if you are looking anything specific with an example.
-
-
what sought of anomalies you are after? are you looking after Polygons doesn't have regular shapes like (Square, rectangle, Hexagonal, Octagon)? Jan 17, 2020 at 6:36
-
Yes. Various kind of problems, but mostly irregular shape. More than 4 vertexes and so on.– DariusJan 17, 2020 at 6:36
-
can you provide example of problem you are seeing in your dataset? The problems in geometry should have been reported in Check Geometry geo processing tool Jan 17, 2020 at 6:50
-
When i run check geometry, in the report, as problem i see only 13 cases (which is impossible) and as PROBLEM there's NULL GEOMETRY– DariusJan 17, 2020 at 7:24