Description
The FilterFeaturesBySpatialRelation process finds features that pass the criteria in a DE9IM (Dimensionally Extended 9‑Intersection Model) matrix.
Inputs
The features to be filtered in a supported format. In the application, e.g. in Select > Features By > Geometry Comparison, this input is named "Target Features". The following formats are currently supported:
• CARIS File *.des
• Bentley/Intergraph DGN *.dgn
• AutoCAD DXF *.dxf
• AutoCAD DWG *.dwg
• ESRI Shapefile *.shp
• Geography Markup Language *.gml
• Keyhole Markup Language *.kml
• MapInfo File *.mid
• MapInfo File *.mif
• MapInfo File *.tab
• SQLite *.sqlite
• GeoPackage *.gpkg
• CARIS Well-Known Text *.wkt
• CARIS H2O *.h2o
• S-100 Dataset *.000
• S-57 Files *.000
• HOB Files *.hob
• VPF Library *.lht
• LandXML Reference Model *.xml
• CARIS Reference Model *.xml
Outputs
Features in a supported format. The following formats are currently supported:
• Geography Markup Language *.gml
• Keyhole Markup Language *.kml
• SQLite *.sqlite
• GeoPackage *.gpkg
• CARIS H2O *.h2o
• HOB Files *.hob
HOB and H2O outputs are only supported if the input is HOB, H2O, or 000 features.
Command Line Syntax
carisbatch --run FilterFeaturesBySpatialRelation --reference-geometries <value> [options] <input> <output>
User Interface Command
Select by Geometry Comparison
Options
The following table describes the parameters available for this process.
Parameter |
| ||||
|---|---|---|---|---|---|
Long | Short | Description | Can Repeat | Notes
| |
--reference-geometries | The reference geometries compared with the input features using the DE9IM spatial relation matrix or matrices. Input features that match the reference geometries based on the criteria in the matrix/matrices are added to the output set of features. The reference geometries can be a full data source (e.g. a file) or a filtered set (a layer, a selection or a previously filtered set). In the desktop application, the Select > Features By > Geometry Comparison command calls the reference geometries "Source Features". Note that reference geometries may be features (e.g. HOB) or plain geometry (e.g. WKT). The supported formats for reference geometries are the same as the supported formats for the input. | FALSE | This must be specified explicitly. | ||
--predicate | A string specifying a spatial predicate, which adds the relevant DE9IM spatial relation matrix or matrices. Each of the supported predicates is explained below. The explanations include an example where A (black) is the input feature and B (red) is the reference feature. | FALSE | |||
| • IS_EQUAL_TO: A reference feature is equal to an input feature if they have the same boundary and the same interior. (In the desktop application: The source geometry and the target feature have the same boundary and interior.) | ||||
| • TOUCHES: A reference feature touches an input feature if the boundaries intersect but the interiors do not intersect. (In the desktop application: The boundaries of the source geometry and the target feature intersect but the interiors do not intersect.) | ||||
| • INTERSECTS: A reference feature intersects an input feature if the boundaries and/or interiors of the features intersect in any way. This is the opposite of Is_Disjoint. (In the desktop application: The boundaries and/or interiors of the target features and the source geometry intersect in any way.) | ||||
| • IS_DISJOINT: Reference features are disjoint from an input feature if the boundary and interior of the input feature do not intersect with any of the reference features. This is useful for identifying features that are outside of the data extents. This is the opposite of Intersects. (In the desktop application: Neither the boundaries nor the interiors of the source geometry intersect with the target features.) | ||||
| • COVERS: A reference feature contains an input feature if every point of the input feature is on the interior or boundary of the reference feature. This is the reverse of Is_Covered_By. (In the desktop application: The target feature completely covers the source geometry. All points of the source geometry are on the boundary or on the interior of the target feature.) | ||||
| • IS_COVERED_BY: A reference feature is covered by an input feature if every point of the reference feature is on the interior or boundary of the input feature. This is the reverse of Covers. (In the desktop application: The target feature is completely covered by the source geometry. All points of the target feature are on the boundary or on the interior of the source geometry.) | ||||
| • CONTAINS: A reference feature contains an input feature if every point of the input feature is on the interior or boundary of the reference feature, and at least one point of the input feature is on the interior of the reference feature. This is the reverse of Is_Within. (In the desktop application: The target feature contains the source geometry. Every point of the source geometry is contained in the boundary of the target feature, and at least one point of the source geometry must be on the interior of the target feature.) | ||||
| • IS_WITHIN: A reference feature is within an input feature if every point of the reference feature is on the interior or boundary of the input feature, and at least one point of the reference feature is on the interior of the input feature. This is the reverse of Contains. (In the desktop application: The target feature is within the source geometry. Every point of the target feature is within the boundary of the source geometry, and at least one point of the target feature must be on the interior of the source geometry.) | ||||
| • CROSSES: A reference feature crosses an input feature if their interiors intersect and the geometry of that intersection has a dimension that is less than that of either the reference feature or the input feature. For example, an area can never be crossed by an area because if the interiors intersect, the intersection will always be an area, which is not of a lower dimension. An area can be crossed by a line or point. (In the desktop application: The target feature and source geometry cross if their interiors intersect, and the geometry of that intersection has a dimension that is less than either the source or the target.) | ||||
| • OVERLAPS: A reference feature overlaps an input feature if both features have the same geometry dimension (e.g. both areas) and the interiors intersect, but the geometry of the intersection is not equal to the geometry of either feature. (In the desktop application: The target feature and source geometry overlap if they have the same dimension and their interiors intersect, but the geometry of the intersection is not equal to either the source or the target.) | ||||
| • BOUNDARY_CONTAINS: A reference feature boundary contains an input feature if every point on the input feature is on the boundary of the reference feature. This is the reverse of Is_Within_Boundary_Of. (In the desktop application: The target feature completely covers the source geometry boundary. All points of the source geometry are on the boundary of the target feature.) | ||||
| • IS_WITHIN_BOUNDARY_OF: A reference feature is within the boundary of an input feature if every point of the reference feature is on the boundary of the input feature. This is the reverse of Boundary_Contains. (In the desktop application: The target feature is completely covered by the source geometry boundary. All points of the target feature are on the boundary of the source geometry.) | ||||
Spatial relation matrices, including ones added through a predicate, are applied pairwise, considering one feature from each source at a time. If any reference feature passes the predicate for an input feature, the input feature passes the filter. Exception: if the disjoint predicate is specified, and no matrices are specified, then an input feature is disjoint if it is disjoint from all references features, not if it is disjoint from a single reference feature. This is optional. At least one matrix must be specified directly or through a spatial predicate. | |||||
--matrix | A string specifying a DE9IM spatial relation matrix with the spatial predicates used to determine if reference features match input features. The string is 9 characters specifying which items in the matrix are true, false or ignored. For more information, refer to https://en.wikipedia.org/wiki/DE-9IM. For example, Is equal to uses T*F**FFF*, and Intersects uses the following four matrices: T********, *T*******, ***T*****,****T**** Spatial relation matrices are applied pairwise, considering one feature from each source at a time. If any reference feature passes the predicate for an input feature, the input feature passes the filter. This is optional. At least one matrix must be specified directly or through a spatial predicate. | TRUE | |||
--feature-catalogue | F | A string specifying the name of the catalogue that defines the features and attributes in the vector dataset. One of {list dynamically populated from the catalogue control file}. The names of the available catalogues can be accessed through the application via the Object Catalogue environment variable in Tools > Options. The available catalogues are controlled by the Catalogue Control file. An example of a catalogue name is "S-57 ENC 3.1". If the input is a feature source that does not have an embedded catalogue reference (e.g. HOB or Shapefile) and the output is a format that requires a defined catalogue (e.g. HOB, H2O), a feature catalogue must be specified. S-57 (.000), S-100 (.000), H2O (.h2o) and VPF (lht) are features sources that have embedded catalogue references and which require a defined catalogue. HOB (.hob) is the only format that does not have an embedded catalogue reference but which requires a defined catalogue. | FALSE | ||
Example
To use this command refer to the following example.
Example | ||
|---|---|---|
Objective | You want to create a subset of features that match the geometry of reference features in a Shapefile. | |
Description | Command Line Syntax | |
The reference geometries are in the Reference.shp file located in D:\SampleData\Features. |
| |
The IsEqualTo matrix will be used for the spatial relation comparison. |
| |
The input features are in the target.gml file located in D:\SampleData\Features. |
| |
The filtered features will be saved to the SpatialRelationOutput.gml file in input directory. |
| |
Command Line |
| |
Outcome | All input features that match the geometries of the features in the Shapefile are saved to the output file. | |
Extra Notes | N/A | |
To use this command refer to the following example.
Example | ||
|---|---|---|
Objective | You want to create a subset of features that intersect with reference features in a Shapefile. | |
Description | Command Line Syntax | |
The reference geometries are in the Reference.shp file located in D:\SampleData\Features. |
| |
The INTERSECT predicate will be used for the spatial relation comparison. |
| |
The input features are in the target.gml file located in D:\SampleData\Features. |
| |
The filtered features will be saved to the SpatialRelationOutput.gml file in input directory. |
| |
Command Line |
| |
Outcome | All input features that intersect with the features in the Shapefile are saved to the output file. | |
Extra Notes | N/A | |