Skip to main content
Solved

SliverRemover shortest boundary option


Forum|alt.badge.img

SliverRemover remover has option Repair Method : (Priority Longest boundary)

 

In my case shortest boundary option needed, I wander if someone knows how to realize this?

Best answer by jdh

You would have to write your own custom transformer to do this. Off the top of my head I would try something like:

 

 

BoundingBoxAccumulator to get a bounding polygon

 

Send the original features and bounding box through an AreaOnAreaOverlayer and test for the Overlap Count Attribute to be 1 (gaps) or greater than 2 (overlaps) (2 would be no overlaps, just the original feature and the bounding box). These are your slivers to be eliminated. Create an attribute to identify them as such. Identify the features with an overlap of 2 to be your reference features. (They are the original features minus any overlapping areas)

 

Send both the reference and slivers to a TopologyBuilder.

 

From the Edge port use a tester to remove any edge where both the left and right faces are 0 (outside edge). Calculate the length of the remaining lines.

From the Face port test to separate the slivers from the reference features.

Send the slivers to the requestors of a ListBasedFeatureMerger. Requestor list attribute should be _edges{}._edge_id, supplier attribute should be _edge_id. Generate a list.

Your slivers should now have a list containing each adjoining edge and it's length, and the ids or the left and right faces

 

Sort the list by length and promote the shortest segment (index 0).

 

One of either the left or right face id will match the face_id of the sliver, get the id of the other one, that is the id of the reference polygon the sliver should be dissolved with.

 

Dissolve the reference features with the slivers, grouping on that id.

There's probably a couple of minor things missing between steps, but in theory this should work.

 

View original
Did this help you find an answer to your question?

3 replies

Forum|alt.badge.img
  • Author
  • November 17, 2017
SliverRemover remover has option Repair Method : (Priority Longest boundary)

 

In my case shortest boundary option needed, I wander if some knows how to realize this?

 


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • November 21, 2017

Solution depends on the objects your talking about.

sample required.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • November 22, 2017

You would have to write your own custom transformer to do this. Off the top of my head I would try something like:

 

 

BoundingBoxAccumulator to get a bounding polygon

 

Send the original features and bounding box through an AreaOnAreaOverlayer and test for the Overlap Count Attribute to be 1 (gaps) or greater than 2 (overlaps) (2 would be no overlaps, just the original feature and the bounding box). These are your slivers to be eliminated. Create an attribute to identify them as such. Identify the features with an overlap of 2 to be your reference features. (They are the original features minus any overlapping areas)

 

Send both the reference and slivers to a TopologyBuilder.

 

From the Edge port use a tester to remove any edge where both the left and right faces are 0 (outside edge). Calculate the length of the remaining lines.

From the Face port test to separate the slivers from the reference features.

Send the slivers to the requestors of a ListBasedFeatureMerger. Requestor list attribute should be _edges{}._edge_id, supplier attribute should be _edge_id. Generate a list.

Your slivers should now have a list containing each adjoining edge and it's length, and the ids or the left and right faces

 

Sort the list by length and promote the shortest segment (index 0).

 

One of either the left or right face id will match the face_id of the sliver, get the id of the other one, that is the id of the reference polygon the sliver should be dissolved with.

 

Dissolve the reference features with the slivers, grouping on that id.

There's probably a couple of minor things missing between steps, but in theory this should work.

 


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