If Spatial Relationship Is (ModelBuilder)

Summary

Evaluates whether the inputs have a specified spatial relationship.

Learn how If Spatial Relationship Is works in ModelBuilder

Usage

  • This tool is intended for use in ModelBuilder and not in Python scripting.

  • The tool has two Boolean outputs, True and False. Based on the condition being evaluated one of the two boolean outputs is true and the other false after the tool runs. These boolean outputs have to be set as a precondition to the downstream tools for those to execute if either of the preconditions is true.

Syntax

SpatialRelationshipIfThenElse(in_features, {overlap_type}, {select_features}, {search_distance}, {invert_spatial_relationship}, {selection_condition}, {count}, {count_min}, {count_max})
ParameterExplanationData Type
in_features

Input features to evaluate.

Feature Layer
overlap_type
(Optional)

The spatial relationship to be evaluated.

  • INTERSECTThe features in the input layer will be selected if they intersect a selecting feature. This is the default.
  • INTERSECT_3DThe features in the input layer will be selected if they intersect a selecting feature in three-dimensional space (x, y, and z).
  • INTERSECT_DBMSThe features in the input layer will be selected if they intersect a selecting feature. This option applies to enterprise geodatabases only. The selection will be processed in the enterprise geodatabase DBMS rather than on the client when all requirements are me (see usage notes). This option may provide better performance than performing the selection on the client.
  • WITHIN_A_DISTANCEThe features in the input layer will be selected if they are within the specified distance (using Euclidean distance) of a selecting feature. Use the search_distance parameter to specify the distance.
  • WITHIN_A_DISTANCE_3DThe features in the input layer will be selected if they are within a specified distance of a selecting feature in three-dimensional space. Use the search_distance parameter to specify the distance.
  • WITHIN_A_DISTANCE_GEODESICThe features in the input layer will be selected if they are within a specified distance of a selecting feature. Distance between features will be calculated using a geodesic formula that takes into account the curvature of the spheroid and correctly handles data near and across the dateline and poles. Use the search_distance parameter to specify the distance.
  • CONTAINSThe features in the input layer will be selected if they contain a selecting feature.
  • COMPLETELY_CONTAINSThe features in the input layer will be selected if they completely contain a selecting feature.
  • CONTAINS_CLEMENTINIThis spatial relationship yields the same results as COMPLETELY_CONTAINS with the exception that if the selecting feature is entirely on the boundary of the input feature (no part is properly inside or outside), the feature will not be selected. CLEMENTINI defines the boundary polygon as the line separating inside and outside, the boundary of a line is defined as its end points, and the boundary of a point is always empty.
  • WITHINThe features in the input layer will be selected if they are within a selecting feature.
  • COMPLETELY_WITHINThe features in the input layer will be selected if they are completely within or contained by a selecting feature.
  • WITHIN_CLEMENTINIThe result will be identical to WITHIN with the exception that if the entirety of the feature in the input layer is on the boundary of the feature in the selecting layer, the feature will not be selected. CLEMENTINI defines the boundary polygon as the line separating inside and outside, the boundary of a line is defined as its end points, and the boundary of a point is always empty.
  • ARE_IDENTICAL_TOThe features in the input layer will be selected if they are identical (in geometry) to a selecting feature.
  • BOUNDARY_TOUCHESThe features in the input layer will be selected if they have a boundary that touches a selecting feature. When the inputs features are lines or polygons, the boundary of the input feature can only touch the boundary of the selecting feature, and no part of the input feature can cross the boundary of the selecting feature.
  • SHARE_A_LINE_SEGMENT_WITHThe features in the input layer will be selected if they share a line segment with a selecting feature. The input and selecting features must be line or polygon.
  • CROSSED_BY_THE_OUTLINE_OFThe features in the input layer will be selected if they are crossed by the outline of a selecting feature. The input and selecting features must be lines or polygons. If polygons are used for the input or selecting layer, the polygon's boundary (line) will be used. Lines that cross at a point will be selected, not lines that share a line segment.
  • HAVE_THEIR_CENTER_INThe features in the input layer will be selected if their center falls within a selecting feature. The center of the feature is calculated as follows: for polygon and multipoint, the geometry's centroid is used; for line input, the geometry's midpoint is used.
String
select_features
(Optional)

The features in the Input Features parameter will be selected based on their relationship to the features from this layer or feature class.

Feature Layer
search_distance
(Optional)

The specified distance that will be searched. This parameter is only valid if the overlap_type parameter is set to one of the following: WITHIN_A_DISTANCE, WITHIN_A_DISTANCE_GEODESIC, WITHIN_A_DISTANCE_3D, INTERSECT, INTERSECT_3D, HAVE_THEIR_CENTER_IN, or CONTAINS.

If the WITHIN_A_DISTANCE_GEODESIC option is selected, use a linear unit such as kilometers or miles.

Linear Unit
invert_spatial_relationship
(Optional)

Specifies whether the spatial relationship evaluation result will be inverted or used as is. For example, this parameter can be used to quickly get a list of features that do not intersect or are not within a given distance of features in another dataset.

  • NOT_INVERTThe result of the query will not be inverted. This is the default.
  • INVERTThe result of the query will be inverted. If the selection_type parameter is used, the inversion occurs before the selection is combined with existing selections.
Boolean
selection_condition
(Optional)

The selection condition for the spatial relationship between the input and selecting features.

  • EXISTSChecks if the spatial relationship exists between any features in the input and selecting features. This is the default.
  • NO_SELECTIONChecks if the spatial relationship does not exist between any of the input and selecting features.
  • ALL_SELECTEDChecks if the spatial relationship exists for all features in the input features.
  • IS_EQUAL_TOChecks if the number of input features with the spatial relationship is equal to the Count value.
  • IS_BETWEENChecks if the number of input features with the spatial relationship is between the Minimum Count value and Maximum Count value.
  • IS_LESS_THANChecks if the number of input features with the spatial relationship is less than the Count value.
  • IS_GREATER_THANChecks if the field value of the records matching the SQL expression is greater than the Count value.
  • IS_NOT_EQUAL_TOChecks if the number of input features with the spatial relationship is not equal to the Count value.
String
count
(Optional)

An integer count value.

Long
count_min
(Optional)

A minimum integer count value.

Long
count_max
(Optional)

A maximum integer count value.

Long

Derived Output

NameExplanationData Type
true

If the specified criteria evaluates to True, this parameter will be set to True.

Boolean
false

If the specified criteria evaluates to False, this parameter will be set to True.

Boolean

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes