Question

Multipolygons to Polygon


Badge
Is there any transformers to aid in  MultiPolygons to simple Polygons.

 

 

I'm going from ESRI Geodatabase to SDF.

 

 

Chris

18 replies

Userlevel 3
Badge +13
how about the deaggregator?
Badge +10
You'll need to consider using the Deaggregator transformer to break your polygon groups into unique entities. Though make sure you retain your ID number or use a Counter to create one first as you may later wish to know which Multipolygon your unique polygon came from...
Badge +1

Even after using a Deaggregator and Tester I still get multiple identical polygons inside of my GeoJSON rendered multi-polygon geometries. I want them to come out as single polygons rather than multi-polygon.

Userlevel 2
Badge +19

Even after using a Deaggregator and Tester I still get multiple identical polygons inside of my GeoJSON rendered multi-polygon geometries. I want them to come out as single polygons rather than multi-polygon.

Could you share a sample of that GeoJSON?

Badge +1

Could you share a sample of that GeoJSON?

grid.json see attached sample. If trimmed to eliminate duplicates this 792 kB file drops to less than 20 kB.

Userlevel 4
Badge +25

grid.json see attached sample. If trimmed to eliminate duplicates this 792 kB file drops to less than 20 kB.

It looks like they're all the same. So your multipolygon consists of a lot of identical polygons. Deaggregating those will indeed give you a lot of identical polygons.

You can use a Matcher to remove duplicate geometries.

Userlevel 2
Badge +19

It looks like they're all the same. So your multipolygon consists of a lot of identical polygons. Deaggregating those will indeed give you a lot of identical polygons.

You can use a Matcher to remove duplicate geometries.

Yes, every feature is formed by the same polygon several times. After the Deaggregator you could also use a DuplicateFilter for "fme_feature_type"

Badge +1

It looks like they're all the same. So your multipolygon consists of a lot of identical polygons. Deaggregating those will indeed give you a lot of identical polygons.

You can use a Matcher to remove duplicate geometries.

I tried matcher for single match and unmatched and still got the multies. I have deaggregator in line but it does not remove them. Now I am curious: Duplicate Filter _after_ Deaggregator seems to be filtering them out, but not before, but even then... not all of them. Still getting multiples.

Userlevel 2
Badge +17

I tried matcher for single match and unmatched and still got the multies. I have deaggregator in line but it does not remove them. Now I am curious: Duplicate Filter _after_ Deaggregator seems to be filtering them out, but not before, but even then... not all of them. Still getting multiples.

Deaggregate first, and then filter out duplicates with the Matcher.

Badge +1

Deaggregate first, and then filter out duplicates with the Matcher.

Matcher has not produced sufficient removal of identical.

Badge +10

Matcher has not produced sufficient removal of identical.

If you are confident all the geometries are identical, you could use a tester after the deaggregator to test for part_number = 0.

 

Badge +3

grid.json see attached sample. If trimmed to eliminate duplicates this 792 kB file drops to less than 20 kB.

@jnotter, to come at this another way: Have you considered using Dissolver? Feed it the aggregate features (ie. Don't use Deaggregator with this method). This will deaggregate the polygon aggregates within the Transformer and merge all overlapping parts into a single polygon. It is somewhat more processor intensive, but it should deal with the fact that some of your multi-polygons aren't quite equal to each other by dissolving the small differences.

Userlevel 2
Badge +17

I think the combination of Deaggregator and Matcher works fine.

 

The workflow generates 20 rectangular polygons independent each other. Isn't this your desired result?

Badge +10

I think the combination of Deaggregator and Matcher works fine.

 

The workflow generates 20 rectangular polygons independent each other. Isn't this your desired result?

I agree, the solutions suggested here all give me the same 20 single polygon output

Badge +1

I think the combination of Deaggregator and Matcher works fine.

 

The workflow generates 20 rectangular polygons independent each other. Isn't this your desired result?

Key question, @takashi, in the back-end data are there duplicates or are you just getting exactly these 20 polygons without overlap of identical?

Badge +1

@jnotter, to come at this another way: Have you considered using Dissolver? Feed it the aggregate features (ie. Don't use Deaggregator with this method). This will deaggregate the polygon aggregates within the Transformer and merge all overlapping parts into a single polygon. It is somewhat more processor intensive, but it should deal with the fact that some of your multi-polygons aren't quite equal to each other by dissolving the small differences.

@bwn, For my purposes each block of the grid must be thematically independent (for color thematic application) of the others, so dissolving into single feature across multiple polygons takes away this capability. The multi-polygons each are a set of identical coordinates, so there are no small differences to tolerate/adapt.

Badge +3

@bwn, For my purposes each block of the grid must be thematically independent (for color thematic application) of the others, so dissolving into single feature across multiple polygons takes away this capability. The multi-polygons each are a set of identical coordinates, so there are no small differences to tolerate/adapt.

Dissolver is typically used with the "Group By" attribute set that ensures that it only dissolves polygon(s) that are part of that group. Since each grid block has its own Name ID, then this can be used to group them and a single polygon feature would be output for each Grid ID.

It Matcher is not removing all the duplicates, this infers that the geometries are not precisely the same, which can happen with data created outside FME due to outside applications not always creating and storing geometry data with absolute precision. Although noting that the test by @takashi on the sample data below indicated that at least in the sample data provided, Matcher works in this case.

Userlevel 2
Badge +17

Key question, @takashi, in the back-end data are there duplicates or are you just getting exactly these 20 polygons without overlap of identical?

There are 20 single polygons, no duplicates. If you still have any problem even if you use the combination of Deaggregator and Matcher, please share your workspace which reproduces the problem.

Reply