5

I have a very funny polygon feature appeared as a result of union of many buffers and cannot repair without manipulating its true shape. Without fixing it, I cannot run subsequent overlay operations. I think the repair geometry tool fixes self-intersecting edges iteratively and consecutive arc edge fixation procedure reproduces the same error again. No matter how many times I try, it reports it is fixed (i.e., 10 times WARNING 000461: Repaired feature 1 because of self intersections) but it returns the same unfixed shape.

UPDATE

Having heard that others have had no issues in repairing this geometry (a proper tail attached to the main part with a 0.03m width), I decided to add a bit more how I came to this point. I have a point feature class with 40.000 features that I need to buffer based on a field and they are pretty close at some locations. These close features tend to produce a large number of slivers. My previous attempts led me to Out of memory or Topoengine errors, and I decided to set the resolution of a copy of this point feature class to 1m (i.e., move points to the closest meter resolution, which might be the source of the problem). I then changed the resolution and tolerance values to their defaults before undertaking any Overlay analysis.

The feature looks like as follows:

enter image description here

For you to replicate the problem in ArcMap, the below is the code snippet including the JSON of this feature considering it is a lossless approximation to the original geometry, which I tested and confirm that it produces the same shape. A word advice, arcpy.AsShape's second argument to process esri_json introduced to this function after the version 10.3, prior versions may complain.

CODE FOR REPRODUCTION

import arcpy

esri_json='{"curveRings":[[[529148.74270000029,6944432.6705999998],{"c":[[529028.58660000004,6943589.9435000001],[529263.99277247302,6943986.3085154826]]},{"c":[[528910,6943597],[528969.39818470867,6943595.2343159467]]},{"c":[[528746.50389999989,6943583.5437000003],[528827.97553651361,6943593.6302468004]]},{"c":[[528172.48149999976,6944406.3706999999],[528570.14691326348,6944072.1521290326]]},{"c":[[528667.5120000001,6944670.9944000002],[528387.14309098024,6944600.1415246446]]},{"c":[[528553.22709999979,6945125.6616000002],[528548.82282015553,6944975.0661100438]]},{"c":[[529145.82980000041,6944433.0010000002],[528546.0329174581,6945033.0851077382]]},{"c":[[529148.74270000029,6944432.6705999998],[529147.28603573283,6944432.8339088196]]}]],"spatialReference":{"wkid":28356,"latestWkid":28356}}'

shape=arcpy.AsShape(esri_json,True)
arcpy.CopyFeatures_management(shape,'in_memory\\repair_me')

Please feel free to put forward any suggestions other than manipulating the shape, e.g., removing vertices, cutting into pieces, generalisation -densification, etc.?

9
  • Feature to line, feature to polygon?
    – FelixIP
    Commented Dec 12, 2016 at 4:40
  • @FelixIP, same outcome.
    – fatih_dur
    Commented Dec 12, 2016 at 5:16
  • 1
    Last try, dissolve in the middle, single part?
    – FelixIP
    Commented Dec 12, 2016 at 5:49
  • @FelixIP, if you are suggesting to somehow avoid creating this feature before having this issue by applying dissolve on buffers, I did that, too (by keeping the attributes at their bare minimum. If I don't, it fails at the later stages again). If this is not what you meant, can you please explain a bit more?
    – fatih_dur
    Commented Dec 12, 2016 at 7:08
  • I mean convert polygon to lines, dissolve them and build polygon again
    – FelixIP
    Commented Dec 12, 2016 at 8:35

2 Answers 2

3

I'm going to assume that the part you want to fix is the "tail" at the top. I'm also going to assume that you only have one such feature and don't require an automated solution to fixing multiple polygons.

To remove the tail, edit the layer and draw another polygon such that it intersects the original polygon at the base of the tail. Select this polygon.

enter image description here

In the editor toolbar, choose Clip.

enter image description here

Choose Discard the area that intersects. enter image description here

Delete the polygon used to clip.

Result:

enter image description here

3
  • Thanks for the suggestion @Fezter, and you are right, the issue is at the tail part. I did not know Clip of Editor toolbar could be used this way. Maybe I should have been much clearer, this is a part of a script and my initial intention was to fix this during the process without a user intervention (it is somewhat implied at the final paragraph). If I cannot find a solution to that, I can mark these features by saving into a new feature class for manual processing and carry on with the non-problematic features.
    – fatih_dur
    Commented Dec 12, 2016 at 5:21
  • Sorry, I somehow missed that paragraph.
    – Fezter
    Commented Dec 12, 2016 at 5:22
  • 1
    Looks like the Apple logo
    – smci
    Commented Dec 12, 2016 at 10:17
1

This is not a solution, just an update on my experiments with the shape in question. I ran your script and got perfectly valid polygon. There is 0.03 m gap, where tail attached to main body:

enter image description here

Repair geometry ran smoothly and gave no warning messages. I suspect there is something else to it. XY tolerance in database perhaps. I keep XY Resolution and XY Tolerance blank in my workbench mxd, because I had a very bad experience in the past experimenting with them.

I also tried to apply my 3-tools solution, explained in comments and the output was the same “repair_me” shape. Puzzle yet to be solved...

4
  • After experimenting with your three-step approach, convert polygon to lines, dissolve them as single part and build polygon again, I found a somewhat approximation to a solution by iteration, which alters the true shape but this can be embed into a script as a custom repair geometry tools. Interested parties can see how it progress if I apply this process iteratively in here, i.sstatic.net/jo3Wl.png
    – fatih_dur
    Commented Dec 13, 2016 at 2:29
  • Lastly, I am using ArcGIS Desktop 10.3.1 and the geometry produced by the snippet in my question (in_memory\\repair_me) cannot be repaired by Repair Geometry. A puzzle to be solved indeed.
    – fatih_dur
    Commented Dec 13, 2016 at 2:35
  • I love using "in_memory" as well to accelerate things. However result can be unexpected, when dealing with geometries saved there, e.g. coordinates of end points derived from lines don't match parent line ends coordinates. How about saving it to FGDB on a fastest hard drive?
    – FelixIP
    Commented Dec 13, 2016 at 2:41
  • Even C:\Temp\Scratch.gdb did not help!
    – fatih_dur
    Commented Dec 13, 2016 at 2:45

Your Answer

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

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