Select to view content in your preferred language

Select Layer by Location Within vs. Completely Within

2581
3
02-11-2019 01:36 PM
deleted-user-1_r2dgYuILKY
Occasional Contributor III

This is something that has been bugging me. When using the Select Layer by Location tool, what is the difference between the overlap types, "Within" and "Completely Within?" I'm working on scripting an analysis of the count of 30 sqft transverse hexagon grid cells inside a polygon. I have yet to see any difference in the count when switching between these two options. Ideally, I would like to have a within option with a user defined threshold, i.e. if 95-99% of the feature in the input layer falls within the selecting layer, include this in the selection. 

0 Kudos
3 Replies
JoshuaBixby
MVP Esteemed Contributor

The difference has to do with how the boundaries are treated.  As much as Esri's documentation has generally improved over the years, they have watered down some documentation.  Referring back to 9.x documentation is helpful in this case:  ArcGIS Desktop Help 9.3 - Using Select By Location 

Are within

This method differs from the Are completely within method in that the geometry of the target feature must fall inside the geometry of the source feature including its boundaries.
For example, using this operator, the state of Montana will be selected even if its boundaries partly overlap that of the country.

Are completely within

For a feature to be considered as being completely within another feature, each point in the geometry of the target feature must fall within the geometry of the source feature excluding the source's boundaries (the boundaries cannot touch). This is the reverse operator from Completely contain. For instance, when using this operator, Wyoming is completely within the United States but Montana is not, as its northern boundaries overlap that of the country.
The source feature must be a polygon or you must apply a buffer around point and line features to use this operator.
The highlighted cyan features are selected because they are completely within the red features.

In terms of using a threshold of overlap, you will have to do a full geoprocessing operation to determine the overlap and then select afterwards. 

DanPatterson_Retired
MVP Emeritus

And some text and visual examples from the Pro help files are also good

Select By Location: graphic examples—Data Management toolbox | ArcGIS Desktop 

JoshuaBixby
MVP Esteemed Contributor

Good point, they actually went back to providing more detail in the Pro documentation about selection criteria.

0 Kudos