Skip to main content
Solved

How to do I drop certain overlapping features based on a set of conditions?

  • September 8, 2021
  • 9 replies
  • 192 views

hannahwh05
Contributor
Forum|alt.badge.img+5

I have 1 dataset with many overlapping features. These overlaps tend to have a different feature name. I have been given a list that tells me which name takes priority over the other. I want to find the overlaps and then just carry through the areas that take priority.

 

For instance ancient woodland trumps everything. Building footprints trump everything else. Wetlands and pumping stations trump grassed areas.

 

I have started with an AreaOnAreaOverlayer, generating a list (OverlapAttributes), AreaCalculator, Counter and Tester, where the _overlaps > 1. I've then added a ListExploder.

 

Where the '_area', '_count' and '_overlaps' are the same, I want to only take the feature with the highest priority name.

 

Am I going about this the right way?

I'm a lost as to where to go from here!

 

Attached is some test data and my workbench so far.

 

Thank you!

Best answer by gazza

The next transformer will be an AttributeValueMapper to map the names to a priority value. So

Ancient Woodland = 1, Building Footprints = 2 etc

Then a Sorter to sort the features on _count first and Priority seconds. In Lowest to Highest order.

Then a Sampler to sample the first feature with Group By set to use the _count value.

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

9 replies

gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • Best Answer
  • September 9, 2021

The next transformer will be an AttributeValueMapper to map the names to a priority value. So

Ancient Woodland = 1, Building Footprints = 2 etc

Then a Sorter to sort the features on _count first and Priority seconds. In Lowest to Highest order.

Then a Sampler to sample the first feature with Group By set to use the _count value.


hannahwh05
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • September 9, 2021
gazza wrote:

The next transformer will be an AttributeValueMapper to map the names to a priority value. So

Ancient Woodland = 1, Building Footprints = 2 etc

Then a Sorter to sort the features on _count first and Priority seconds. In Lowest to Highest order.

Then a Sampler to sample the first feature with Group By set to use the _count value.

I'll give this a go, thank you!


geomancer
Evangelist
Forum|alt.badge.img+48
  • Evangelist
  • September 9, 2021

Another approach, that makes use of list functionality.

Area priority 

  • Make sure all polygons hava a unique number (use the UUIDGenerator to create one)
  • Use the AttributeValueMapper to map the names to a priority value, as @Gary Nicholson​ proposes
  • Perform an AreaOnAreaOverlayer, add the feature name, priority and ID attributes to a list
  • Use a ListSorter on the priority attribute
  • Use a ListIndexer to write the values of listitem 0 (feature name, priority and ID ) into the corresponding attributes
  • Use a Dissolver on ID and feature name (or ID and priority) to combine adjacent objects with identical attributes
  • Optionally add an Aggregator on ID and feature name (or ID and priority) to combine disjunct objects with identical attributes

See the attached workspace (based on the solution to this question) for a mockup.


hannahwh05
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • September 9, 2021
geomancer wrote:

Another approach, that makes use of list functionality.

Area priority 

  • Make sure all polygons hava a unique number (use the UUIDGenerator to create one)
  • Use the AttributeValueMapper to map the names to a priority value, as @Gary Nicholson​ proposes
  • Perform an AreaOnAreaOverlayer, add the feature name, priority and ID attributes to a list
  • Use a ListSorter on the priority attribute
  • Use a ListIndexer to write the values of listitem 0 (feature name, priority and ID ) into the corresponding attributes
  • Use a Dissolver on ID and feature name (or ID and priority) to combine adjacent objects with identical attributes
  • Optionally add an Aggregator on ID and feature name (or ID and priority) to combine disjunct objects with identical attributes

See the attached workspace (based on the solution to this question) for a mockup.

Thank you! Hadn't thought about using a dissolver.


hannahwh05
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • September 9, 2021
gazza wrote:

The next transformer will be an AttributeValueMapper to map the names to a priority value. So

Ancient Woodland = 1, Building Footprints = 2 etc

Then a Sorter to sort the features on _count first and Priority seconds. In Lowest to Highest order.

Then a Sampler to sample the first feature with Group By set to use the _count value.

@Gary Nicholson​ any idea how I retain the areas that did not overlap?

fmeAreas


gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • September 9, 2021
hannahwh05 wrote:

@Gary Nicholson​ any idea how I retain the areas that did not overlap?

fmeAreas

Those ones are coming out of the failed port of the tester. IE. The _overlaps value is 0.


gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • September 9, 2021
geomancer wrote:

Another approach, that makes use of list functionality.

Area priority 

  • Make sure all polygons hava a unique number (use the UUIDGenerator to create one)
  • Use the AttributeValueMapper to map the names to a priority value, as @Gary Nicholson​ proposes
  • Perform an AreaOnAreaOverlayer, add the feature name, priority and ID attributes to a list
  • Use a ListSorter on the priority attribute
  • Use a ListIndexer to write the values of listitem 0 (feature name, priority and ID ) into the corresponding attributes
  • Use a Dissolver on ID and feature name (or ID and priority) to combine adjacent objects with identical attributes
  • Optionally add an Aggregator on ID and feature name (or ID and priority) to combine disjunct objects with identical attributes

See the attached workspace (based on the solution to this question) for a mockup.

I would have used the ListSorter as well rather than exploding the list, but I didn't want to completely rewrite the workspace as @Hannah Wheldon​ was almost there.

As always with FME there are multiple ways to do things.


hannahwh05
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • September 10, 2021
hannahwh05 wrote:

@Gary Nicholson​ any idea how I retain the areas that did not overlap?

fmeAreas

@Gary Nicholson​ thank you for all your help! Slight facepalm moment with that last question!


hannahwh05
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • September 10, 2021
gazza wrote:

I would have used the ListSorter as well rather than exploding the list, but I didn't want to completely rewrite the workspace as @Hannah Wheldon​ was almost there.

As always with FME there are multiple ways to do things.

@geomancer​ @Gary Nicholson​ good to see the other ways of doing this while I'm still in my early days of FME


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