Skip to main content
Question

Geometry Challenge - Dissolve slivers with the biggest adjacent polygon

  • February 11, 2025
  • 6 replies
  • 82 views

galigis
Enthusiast
Forum|alt.badge.img+16

Hi All,

I wanted to dissolve (or merge) little slivers with the biggest adjacent polygon to harmonise my data, an example below where you can see the little slivers (selected):

 

How can I achieve this with FME?

Thanks :)

6 replies

joepk
Influencer
Forum|alt.badge.img+20
  • Influencer
  • February 11, 2025

Hello, you can try the following:

  • AreaCalculator to calculate the area of all non-sliver features.
  • Counter/UUIDGenerator/whatever to generate a ID on all non-sliver features. 
  • Counter/UUIDGenerator/whatever to generate a differently named ID on all sliver features.
  • SpatialRelator to transfer the ID and area of each non-sliver feature to your sliver features as a list.
  • ListExploder to explode the list on your features, resulting in N amount of the same sliver features (for N amount of non-sliver neighbors).
    • The duplicate sliver geometries each have an ID and an area of one of the adjacent non-sliver features.
  • StatisticsCalculator (grouped by sliver ID) to get the largest area of the non-sliver feature for each sliver feature.
  • FeatureJoiner/FeatureMerger to join the statistic feature (containing sliver ID, largest non-sliver ID, largest non-sliver area) back to your sliver features. Join on sliver ID
    • Your original sliver features now have the IDs of the largest non-sliver features attached
  • Dissolver with your entire dataset as input. Grouped by non-sliver ID. Non-slivers without a match will not be affected.

I dont have any workspace examples on hand right now, as I am on lunch break, but I could provide this if you can provide test data.

If you like these kind of puzzles and you have some extra time on hand, you can also try to figure out how to get the slivers to dissolve to the neighboring feature with which it shares the largest border. A bit more tricky but a fun FME exercise nonetheless. Could also return some cleaner results. The largest-area-method could result in unwanted dissolving of the top-most feature (if it shares a border with the larger feature in the middle of the extrusion).

 


galigis
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • February 11, 2025

Thanks ​@joepk  - I like the idea of the ‘largest border approach’. it makes more sense. Attached some sample data if you could play around with. I like to dissolve anything less than 0.001 Ha to the largest shared polygon if possible.

 

I’m also looking into the following resources:

 

 

Thanks!

 


mark2atsafe
Safer
Forum|alt.badge.img+43
  • Safer
  • February 11, 2025

One thing you could do is to delete the slivers and then use the AreaGapAndOverlapCleaner transformer to fill them in by expanding a neighboring polygon.

If you calculated the area of each polygon, you could apply that as the priority parameter to ensure the largest polygons are used to fill in the gaps.

The downside here is that it won’t work when the sliver is on the edge of the polygon coverage.


galigis
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • February 11, 2025

Thanks ​@mark2atsafe you are right, it’s an elegant way of fixing the challenge but those polygons on the edge won’t be included...it’s a shame. I have just tested and seems that’s the case,


joepk
Influencer
Forum|alt.badge.img+20
  • Influencer
  • February 19, 2025
galigis wrote:

Thanks ​@joepk  - I like the idea of the ‘largest border approach’. it makes more sense. Attached some sample data if you could play around with. I like to dissolve anything less than 0.001 Ha to the largest shared polygon if possible.

 

I’m also looking into the following resources:

 

 

Thanks!

 

Hi, sorry for the late reply. I don't have a lot of time on hand to create a workspace for you. But I think I have used jlbaker2779's approach from the first thread you linked when I was faced with this challenge a while ago.

Shouldn't take you more than an hour if you copy their workspace. The hardest part (for me) was passing on the right ID to the right polygon.

Good luck!


juanmahere
Supporter
Forum|alt.badge.img+11
  • Supporter
  • February 21, 2025

Hi ​@galigis ,

I’ve always used the idea of the largest shared boundary, use to work finely.
Some good trick, that solve many of non-desired neighbors that only touches one single vertex, so you simplify a lot, is to use a Snipper 5-95, so you use almost the same border, just with a stretched a 5%.
Let me know if you’re still on trouble to build this process.

Just got into my mind that I’ve used a CenterLineReplace with AreaBuilder to split my sliver into little fragments, so they can be dissolved in a more “natural” way with the neighbors.

 

Keep in touch,

J.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings