0

The Eliminate tool offers a useful way of getting rid of thousands of small gaps and overlaps (slivers) automatically.

According to its description, it "eliminates polygons by merging them with neighboring polygons that have the largest area or the longest shared border".

However, this would not quite be the result that I need.

I am looking for a way to control the merging behaviour based on a background layer (OS MasterMap).


In the example below, the sliver (G) would normally be merged with the larger polygon (A).

However, here I would need it to be merged with polygon B (but not because it is the smaller one).

That way, the shared boundary of A and B would get aligned with the MasterMap boundary (the grey lines of the background layer).

EDIT 1: So, in some cases, slivers would get merged with the larger polygons, while in other cases with the smaller ones.

example image

Is there any way to achieve this without having to go though more than 100,000 cases like this individually?

EDIT 2: I should clarify that the yellow polygons (A and B) are part of the same layer. I am trying to fix errors (gaps and overlaps) on the yellow layer. G could be a gap or an overlap (but in the way I've drawn it in my illustration it is a gap -- I have a lot more gaps than overlaps to fix!).

5
  • 1
    Its not clear if G is a gap between A and B or its from a separate layer and is overlapping B, if it is an overlap then consider exploring the Union tool. Commented Aug 23, 2022 at 22:51
  • 1
    Very nice task for python. I'd do a)union of itself with no gaps, b) iterate through gaps - find all parents that share a boundary with gap, union with one parent, compute total perimeter, union with second parent, compute perimeter, etc. Assign parent ID to gap for combination with smallest perimeter. Commented Aug 24, 2022 at 2:48
  • @Hornbydd You are right, I should have clarified this. I have now edited my post to include these details! Commented Aug 24, 2022 at 10:25
  • @FelixIP I am not trying to have slivers merged with the smaller polygons, only to get the polygons aligned with MasterMap. So in some cases the merge will be done with the larger polygons, while in other cases with the smaller ones. I have now edited my question to clarify this Commented Aug 24, 2022 at 10:31
  • 1
    My suggestion has nothing to do with picking smaller polygon. Merge G to A, compute sum of perimeter A and B. Merge G to B and recompute same sum. Commented Aug 24, 2022 at 18:58

1 Answer 1

0

Here is a flow I would follow when automating this process: (I would do this in Python, you do you.)

  1. Identify the slivers. To do this, make a copy of the original layer source, perform an Eliminate on it, join the original layer A to the eliminated layer B using the object ids as the join key. Select by attribute those in A not matching in B... These are the slivers. Export these to a new FC.

  2. Find the associated master map polygon for all A features including slivers. To do this, preform a poly to centroid point on A, then a point-in-poly overlay with the master map polygons. Calculate back to the original A features the master map for all polys.

(At this point, you have the slivers identified and everything coded to which master map they belong, now the tedious part.)

  1. Cursor thorough all slivers in the A featureclass, and for each one individually: identify the largest, adjacent non-sliver with the same master map value. Perform a geometry merge of this two features, writing them to a repaired FC

  2. After all slivers have met and merged with their largest, adjacent, matching master map polygon, then you can delete them all from A and merge all of the repaired features back into the A.

3
  • Whoops, after I posted I saw FelixlP made a similar comment suggestion above. Great minds think alike, but don't wanna appear like a plagiarist. Commented Aug 24, 2022 at 4:44
  • "3. Cursor through all slivers..." I understand that at this step I would be looking at each sliver individually (?) If not, please detail. (Back to this project after a short break. Exciting to see a suggested approach!) Commented Sep 4, 2022 at 7:04
  • Yes, and I updated my answer to emphasize the individual nature of a database cursor that cycles through every row one at a time kind of like a foreach() statement. Commented Sep 5, 2022 at 17:20

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.