FME Transformers: 2024.1
FME Transformers: 2024.1
AreaGapAndOverlapCleaner
Repairs area topologies by resolving gaps and overlaps between adjacent areas.
Typical Uses
- Cleaning topology errors in a polygon coverage to create a single, contiguous surface.
How does it work?
The AreaGapAndOverlapCleaner receives features with valid area geometry and cleans up shared boundaries by dissolving overlaps and filling in gaps between polygons.
Input aggregate geometry may be either deaggregated or rejected.
Z values and measures are supported.
Repairing Overlaps and Gaps
Overlaps and gaps are processed slightly differently.
Both use the Tolerance and Repair Method parameters to determine how they are resolved. Gaps are further handled according to the Fill All Gaps parameter.
Overlaps are all processed, all the time. If the overlap is within the Tolerance distance, the repair is done automatically. If the overlap is greater than the tolerance, the Repair Method choice is used.
Gaps within the Tolerance distance are repaired automatically. If Fill All Gaps is Yes, gaps greater than the tolerance are repaired according to the Repair Method choice. If Fill All Gaps is No, they are not repaired.
|
Fill All Gaps |
Within Tolerance |
Greater Than Tolerance |
---|---|---|---|
Overlaps |
|
Automatic |
Per Repair Method |
Gaps |
No |
Automatic |
Untouched |
Gaps |
Yes |
Automatic |
Per Repair Method |
Tolerance
Tolerance is a distance in the ground units of the features’ coordinate system. The choices are to enter a value or choose Automatic.
For most transformers with a Tolerance parameter, Automatic is recommended, but it is frequently not the correct choice here. Automatic will calculate a value that accounts for minute differences introduced by binary limitations, rounding errors, and the like (See Geometry Concepts > Tolerance). The calculated value is written to the log file.
Tolerance is always greater than zero.
Tolerance > Automatic does not consider the size of gaps and overlaps present in the data. For many use cases, this value is too small and an explicit value should be entered. The value should be guided by the nature of the input geometry (size of gaps and polygons) and whether you want the repairs to be automatically handled or determined by a specific Repair Method.
Repair Method
Gaps and overlaps greater than the Tolerance value are repaired according to the Repair Method:
- Longest Boundary: Gaps and overlaps are allocated to the area with the longest boundary.
- Random: Gaps and overlaps are allocated to areas selected at random.
- Priority (Edge Preserving): Gaps and overlaps are allocated according to a numeric priority attribute:
- Overlaps go to the higher priority area.
- Gaps go to the lower priority area.
- The boundary of the higher priority area is preserved.
- Priority (Area Enlarging): Gaps and overlaps are allocated according to a numeric priority attribute:
- Both overlaps and gaps go to the higher priority area.
- The higher priority area may be enlarged.
When using Priority methods, zero (0) is the highest priority. If there is a conflict where more than one area has the same priority, one is selected arbitrarily.
Examples
Example: Using appropriate Tolerance values
In this example, we have a set of parcel features, separated in places by roadways and lanes.
On close examination, the data is not clean and needs to be repaired. There are random overlaps and gaps.
Note that this laneway is approximately 6 meters wide. It a valid gap that should be preserved.
Tolerance: Too Large
The features are routed into an AreaGapAndOverlapCleaner.
In the parameters dialog, Tolerance is set to 20 (meters, in ground units). Fill All Gaps is No, so that only gaps within the tolerance will be repaired.
The results are not good. As the tolerance is wider than the valid gap, the laneway has been filled in, crookedly.
When tolerance is too large, unpredictable results occur, including spikes, deformed shapes, and valid areas filled in.
Tolerance: Just Right
The features are routed into an AreaGapAndOverlapCleaner.
In the parameters dialog, Tolerance is set to 2.5 - a value that is less than the width of valid gaps, but large enough to capture the errors.
Gaps and overlaps are repaired.
Valid gaps are preserved and feature shapes are intact.
Example: Using Priority to determine gap and overlap allocation
In this example, we have two datasets with area geometry - zoning polygons and two-line rivers. Note that the selected zone polygon has a PRIORITY value of 1.
We want contiguous coverage, with the zones meeting the river’s edge.
On closer inspection, the two datasets do not meet smoothly. There are gaps and overlaps. Note that the river polygon has a PRIORITY value of 0.
We want to clean up the data and preserve the shape of the river polygons - not adjust the river to the shape of the zones.
Both datasets are routed into AttributeCreators to add their PRIORITY value, and then on to an AreaGapAndOverlapCleaner.
In the parameters dialog, Tolerance is set to Automatic. This will compute an extremely small tolerance number (see Tolerance above).
All of the visible errors will be much larger than this tolerance, and so will have the Outside Tolerance Parameters applied - Fill All Gaps, Repair Method, and Priority Attribute.
Repair Method is set to Priority (Edge Preserving), with the PRIORITY attribute chosen.
Zero (0) is the highest priority.
Overlaps are absorbed into the river, and gaps are added on to the zones. The shape of the river is preserved, and the coverage is contiguous.
Usage Notes
- When unexpected results are output, it can often be corrected by adjusting the Tolerance value.
- To repair only overlaps (not gaps), consider using a Dissolver.
- Invalid area geometry such as self-intersecting or degenerate polygons will not be rejected, but will not be repaired properly.
- Donut holes are gaps, and may be processed accordingly.
Creating and Modifying Area Features
These transformers work with polygons in a variety of ways.
Area Transformers Comparison
|
Function |
Transformer Description |
---|---|---|
Creating areas from topologically connected lines where they form closed shapes. |
Creates polygons from topologically correct linear features. |
|
Creating areas from individual linear features. |
Converts a linear feature to an area by connecting the end point to the start point. |
|
Combining touching or overlapping areas to create larger areas. |
Combines overlapping and/or adjacent areas into larger contiguous areas by removing shared and interior edges. |
|
Calculating areas. |
Calculates the planar or sloped area of polygon geometries and adds the results as attributes. |
|
Cleaning up overlaps and gaps to create contiguous coverage. |
Repairs area topologies by resolving gaps and overlaps between adjacent areas. |
|
Generalizing areas. |
Generalizes area geometry by connecting and combining neighboring features and/or filling in holes and details. |
|
Converting donut areas to non-donut areas by connecting holes to the perimeter. |
Builds connections between donut holes with the outer boundary of a donut, resulting in a polygon-equivalent representation of the input donut. |
|
Converting areas within areas to donut holes. |
Cuts holes in area features where they fully enclose another area, creating donut polygons. |
|
Separating donut areas into their parts. |
Separates donut polygons into outer shell and hole polygons. |
|
Counting the number of holes in a donut area. |
Adds a new attribute whose value is the number of holes in the feature. If the feature is not a polygonal feature, 0 will be returned. |
|
Finding polygon overlaps and extracting them into new geometry. |
Performs an area-on-area overlay (intersection of polygons) so that all input areas are intersected against each other and resultant area features are created and output. The resultant areas can accumulate attribute from any overlapping polygons. |
|
Finding intersections between lines and polygons, splitting either where they intersect. |
Performs a line-on-area overlay, either splitting lines where they intersect area boundaries or subdividing areas where split by lines. Attributes may be shared between related lines and areas (spatial join). |
|
Identifying points that fall within polygons, and sharing attributes between them. |
Performs a point-in-polygon overlay. Points may receive containing area attributes, and areas may receive contained point attributes (spatial join). |
Configuration
Input Ports
Input
Features with area geometry.
Output Ports
Repaired
Features with gaps and overlaps resolved are output here, including untouched input features.
Remnants
Geometries that collapsed within tolerance are output here, as well as any features left with null geometry after overlap resolution.
<Rejected>
Features with invalid geometries will be rejected and output via this port.
When Repair Method is Priority (Edge Preserving) or Priority (Area Enlarging), features with invalid priority attributes will also be rejected via this port.
Rejected features will have an fme_rejection_code attribute with one of the following values:
INVALID_GEOMETRY_TYPE
INVALID_PARAMETER_PRIORITY_ATTRIBUTE
Rejected Feature Handling: can be set to either terminate the translation or continue running when it encounters a rejected feature. This setting is available both as a default FME option and as a workspace parameter.
Parameters
Group Processing
Group By |
The default behavior is to use the entire set of features as the group. This option allows you to select attributes that define which groups to form. |
||||
Complete Groups |
Select the point in processing at which groups are processed:
Considerations for Using Group By
There are two typical reasons for using When Group Changes (Advanced) . The first is incoming data that is intended to be processed in groups (and is already so ordered). In this case, the structure dictates Group By usage - not performance considerations. The second possible reason is potential performance gains. Performance gains are most likely when the data is already sorted (or read using a SQL ORDER BY statement) since less work is required of FME. If the data needs ordering, it can be sorted in the workspace (though the added processing overhead may negate any gains). Sorting becomes more difficult according to the number of data streams. Multiple streams of data could be almost impossible to sort into the correct order, since all features matching a Group By value need to arrive before any features (of any feature type or dataset) belonging to the next group. In this case, using Group By with When All Features Received may be the equivalent and simpler approach. Note Multiple feature types and features from multiple datasets will not generally naturally occur in the correct order.
As with many scenarios, testing different approaches in your workspace with your data is the only definitive way to identify performance gains. |
General
Tolerance |
Specify the maximum distance (in ground units) between geometries in 2D for features to be automatically repaired. If Automatic, tolerance is calculated based on the input features and addresses only extremely small variations. The value is written to the log file. See Tolerance above, as well as Geometry Concepts > Tolerance. |
Aggregate Handling |
Choose how aggregate geometries are to be handled. Deaggregate: Decompose aggregates into their individual components. With this setting, the transformer might output more features than were given as inputs. Reject: Do not process aggregates and output them via the <Rejected> port. |
Z and Measures Parameters
Connect Z Mode |
If applicable, select a method for handling z values. Connect Z Mode
When viewed in 2D (ignoring Z), a path (which may define the border of a polygon) may appear to be closed as shown in the left figure below. This same path, when viewed in 3D, may appear to be open as shown in the right figure below.
To specify how (and if) paths should be closed in 3D, select one of the listed modes.
|
||||||||||||||||||
Measures/Z Conflict Value |
Select a method for handling geometries that have a measure, but are missing at least one value, or that have z values but are missing at least one value.
|
||||||||||||||||||
Treat Measures as |
When using the Compute mode to compute missing measure values, measures can be considered Continuous, and linearly interpolated from their neighbors, or they can be Discrete, and taken exactly from the nearest neighbor. |
Outside Tolerance Parameters
Fill All Gaps |
Select an option for gaps repair:
|
||||||||
Repair Method |
Select a method for repairing gaps and overlaps that are larger than the Tolerance value.
|
||||||||
Priority Attribute |
When Repair Method is either Priority (Edge Preserving) or Priority (Area Englarging), specify the attribute containing the priority value. Priority values are positive integers. Zero (0) denotes the highest priority. |
Editing Transformer Parameters
Transformer parameters can be set by directly entering values, using expressions, or referencing other elements in the workspace such as attribute values or user parameters. Various editors and context menus are available to assist. To see what is available, click beside the applicable parameter.
How to Set Parameter Values
Defining Values
There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters.
Using the Text Editor
The Text Editor provides a convenient way to construct text strings (including regular expressions) from various data sources, such as attributes, parameters, and constants, where the result is used directly inside a parameter.
Using the Arithmetic Editor
The Arithmetic Editor provides a convenient way to construct math expressions from various data sources, such as attributes, parameters, and feature functions, where the result is used directly inside a parameter.
Conditional Values
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
Content
Expressions and strings can include a number of functions, characters, parameters, and more.
When setting values - whether entered directly in a parameter or constructed using one of the editors - strings and expressions containing String, Math, Date/Time or FME Feature Functions will have those functions evaluated. Therefore, the names of these functions (in the form @<function_name>) should not be used as literal string values.
Content Types
These functions manipulate and format strings. | |
Special Characters |
A set of control characters is available in the Text Editor. |
Math functions are available in both editors. | |
Date/Time Functions | Date and time functions are available in the Text Editor. |
These operators are available in the Arithmetic Editor. | |
These return primarily feature-specific values. | |
FME and workspace-specific parameters may be used. | |
Creating and Modifying User Parameters | Create your own editable parameters. |
Dialog Options - Tables
Table Tools
Transformers with table-style parameters have additional tools for populating and manipulating values.
Row Reordering
|
Enabled once you have clicked on a row item. Choices include:
|
Cut, Copy, and Paste
|
Enabled once you have clicked on a row item. Choices include:
Cut, copy, and paste may be used within a transformer, or between transformers. |
Filter
|
Start typing a string, and the matrix will only display rows matching those characters. Searches all columns. This only affects the display of attributes within the transformer - it does not alter which attributes are output. |
Import
|
Import populates the table with a set of new attributes read from a dataset. Specific application varies between transformers. |
Reset/Refresh
|
Generally resets the table to its initial state, and may provide additional options to remove invalid entries. Behavior varies between transformers. |
Note: Not all tools are available in all transformers.
For more information, see Transformer Parameter Menu Options.
Reference
Processing Behavior |
|
Feature Holding |
Yes |
Dependencies | |
Aliases | SliverRemover |
History |
FME Community
The FME Community is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.
Search for all results about the AreaGapAndOverlapCleaner on the FME Community.
Examples may contain information licensed under the Open Government Licence – Vancouver, Open Government Licence - British Columbia, and/or Open Government Licence – Canada.