SpatialRelator
Determines topological (spatial) relationships between sets of features. It tags – but does not otherwise change – features when they have certain relationships, such as touches, overlays, intersects, and so forth. Use this transformer when you need to determine the relationships between features or if you have many Requestor features. If you only need to determine if the features are related and you only have a few Requestor features, the SpatialFilter transformer is more efficient.
All Requestor features are output through the Output port, with a new list attribute appended. Each input Supplier feature is compared against the Requestor features, based on the spatial tests specified in the Tests to Perform parameter. When one of the comparisons is true, an entry is added to the Requestor’s list attribute as follows:
<LIST_NAME>{i}.de9im = [DE9IM string]
<LIST_NAME>{i}.pass{0} = [true PREDICATE 1]
<LIST_NAME>{i}.pass{1} = [true PREDICATE 2]
...
<LIST_NAME>{i}.pass{n} = [true PREDICATE n+1]
Additionally, all attributes of the matching Supplier will be added to the list.
As well, each Requestor receives the attributes of the Suppliers that passed the relationship, resulting in an operation referred to as a Spatial Join When attributes are merged down from Supplier to Requestor features, existing attributes are not replaced. Therefore if the Suppliers and Requestors have attributes with the same name, then the values will not be transferred down. This can be worked around by renaming (AttributeRenamer), prefixing (AttributeExpressionRenamer), or removing (AttributeRemover) attributes to avoid name collisions.
Input Ports
Features that will be compared and then output with a tagged list describing the relationships.
Features that will be used to compare with Requestor features, but not output.
Output Ports
These are the Requestor features with the new attributes added. One list entry is made for each of the Suppliers that has at least one matching predicate.
Requestor and Supplier features with invalid geometries will be rejected and output via this port. Supplier features with no or invalid predicates will also be output via this port.
Rejected features will have an fme_rejection_code attribute with one of the following values: INVALID_BASE_GEOMETRY_NOT_OGC_VALID, INVALID_BASE_GEOMETRY_TYPE, INVALID_BASE_GEOMETRY_VERTICES, INVALID_CANDIDATE_GEOMETRY_NOT_OGC_VALID, INVALID_CANDIDATE_GEOMETRY_TYPE, INVALID_CANDIDATE_GEOMETRY_VERTICES, INVALID_CANDIDATE_PARAMETER_PREDICATE, INVALID_GEOMETRY_TYPE, MISSING_CANDIDATE_PARAMETER_PREDICATE.
Parameters
Transformer
This parameter is used to indicate that only Requestors and Suppliers that have the same value for certain attributes should be compared. That is, if Group By attributes are specified, candidates are only compared to requestors that have the same values in these attributes.
Note: How parallel processing works with FME: see About Parallel Processing for detailed information.
This parameter determines whether or not the transformer should perform the work across parallel processes. If it is enabled, a process will be launched for each group specified by the Group By parameter.
Parallel Processing Levels
For example, on a quad-core machine, minimal parallelism will result in two simultaneous FME processes. Extreme parallelism on an 8-core machine would result in 16 simultaneous processes.
You can experiment with this feature and view the information in the Windows Task Manager and the Workbench Log window.
No: This is the default behavior. Processing will only occur in this transformer once all input is present.
By Group: This transformer will process input groups in order. Changes on the value of the Group By parameter on the input stream will trigger batch processing on the currently accumulating group. This will improve overall speed if groups are large/complex, but could cause undesired behavior if input groups are not truly ordered.
Tests
If the Support Mode is Support Aggregates, both multis and aggregate geometries will be supported. However, the only supported predicates will be Contains, Equals, Intersects, Touches, and Within. The Overlaps predicate and the Crosses predicate will not be supported. 9-character masks representing Dimensionally Extended 9 Intersection Matrices will also not be supported.
If the Support Mode is Support All Predicates, all the predicates described in the Spatial Relations Defined page will be supported. However, aggregate and multi geometries will not be supported.
This parameter lists the spatial predicates that will be used for comparisons between the requestor and supplier features. These can either be selected directly from the list, or taken from attribute values.
If the Support Mode is Support All Predicates, you may also test relationships using arbitrary 9-character masks. Such masks consist of the rows of a Dimensionally Extended 9 Intersection Matrix. Note that in order to use these masks with the SpatialRelator, you must assign them to an attribute on the Supplier features, and include the value of that attribute in the Tests to Perform clause (you cannot specify them directly). Multiple predicates may be specified in one attribute by separating them with a space.
Note that this transformer does not allow a matrix representing a disjoint relationship to be used. This includes any matrix that has F or * in all of the four top-left elements. If you wish to find features that are disjoint to another feature, the SpatialFilter may be used.
For more information about predicates, see Spatial Relations Defined.
This attribute controls which attributes must have different values before a match is declared.
This parameter specifies how to determine the boundary of curve and multicurve geometries. The Default Rule is that any curve endpoints that occur an odd number of times in the geometry as a whole, will be considered its boundary – that is, a linear loop (a line whose start point equals its endpoint) will not have any boundary. The other rule specifies that the curve or multicurve's boundary is the set of all its endpoints.
Output
This parameter specifies the name of the list attribute that will be added to the Requestor features.
Note: List attributes are not accessible from the output schema in Workbench unless they are first processed using a transformer that operates on them, such as ListExploder or ListConcatenator. All list attribute transformers are displayed in the Contents pane of the Transformer Help under Lists. Alternatively, AttributeExposer can be used.
This attribute specifies the name of an attribute that will be added to each requestor, which stores the number of suppliers with which the requestor had at least one true relationship.
If this parameter is specified, then for each supplier that matches a requestor, three attributes will be added to the corresponding list entry: card_point, card_line, and card_area. These count the number of points, lines, and areas that comprise the intersection of the requestor and supplier. For instance, a point is counted if two polygons touch at a vertex, a line is counted if they touch at an edge, and an area is counted if they overlap.
When checked, enables options for merging feature type attributes.
- Merge Supplier: Attributes from all features are merged. Conflicts are handled according to parameter Conflict Resolution.
- Prefix Supplier: All supplier attributes are prefixed with a value specified by the Prefix parameter.
- Only Use Supplier: Only attributes from supplier features are used.
Specifies how to handle attribute conflicts when Accumulation Mode is Merge Supplier.
Use Requestor : Gives priority to requestors.
Use Supplier: Gives priority to suppliers.
When Accumulation Mode is Prefix Supplier, the specified value prefixes supplier attributes.
Usage Notes
Spatial relations are based on the OGC specification and are undefined for geometries that are not OGC valid or aggregate geometries.
See Spatial Relations Defined for more information on spatial predicates and an illustration of spatial relationships.
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Transformer Categories
FME Licensing Level
FME Professional edition and above
Search FME Knowledge Center
Search for samples and information about this transformer on the FME Knowledge Center.