MultilayerAreaGeneralizer

From fmepedia

Our standard AreaGeneralizer transformer works very well as long as we send to it only one layer of data. But what would happen if we want to generalize more that one layer and still need to keep topologically clean relationships between features?

We can take a simple example with administrative boundaries, a state and its counties:

and simply pass it through AreaGeneralizer. Results are unpredictable and far from being correct:

As the illustration shows, AreaGenralizer not only looses some features, it also produces some orphaned features, which do not know where they came from - dark blue color represents features with no layer information.

MultilayerAreaGeneralizer takes multiple layers into account. Generalization keeps all the layers and all the features in place as long as they meet the tolerance criteria:

First, when I was thinking what would be the easiest way to make MultilayerGeneralizer, I decided I could simply use Intersector, LineGeneralizer, and AreaBuilder after that. I also thought I would generate centroids separately for each layer to store layer information and all other attributes, and then use them to transfer attributes back to generalized features. It worked well in most cases, but I definitely didn't want to add to the transformer description a note that it won't work for some features - crescent like shapes can be generalized in such a way that their centroid will be outside of the feature:

So, the best way to preserve attributes would be keeping them with the lines, and - in case of shared boundaries - using lists to store multiple sets of attributes. And such a wonderful coincidence - AreaBuilder just recently got the ability to handle lists. The transformer now works as follows:

  • Intersector merges layers and deletes duplicate geometries. Their original attributes are kept in list attributes. That is, if we had three areas sharing a portion of a boundary, we will get one line with three list attributes.
  • LineGeneralizer simplifies features.
  • ListExploder creates as many lines as many list attributes we have of the feature. Instead of a line mentioned above we will get three lines.
  • AreaBuilder creates areas from the lines and collects their attributes into another list attribute.-
  • ListHistogrammer sorts the list in a way that the most frequent set of attributes in the list becomes first (with index = 0) in the list.
  • ListIndexer copies the most frequent attribute in the list into main feature attributes.
Attached Files
filesizedate
MultilayerGeneralizer.zip395.4 kB12/18/07
areageneralizer.png10.8 kB12/18/07
centroidproblem.png3.7 kB12/18/07
multilayer.png11.7 kB12/18/07
source.png12.5 kB12/18/07
User Comments Add a new comment