Find Existing Locations

Note:

This tool is now available in Map Viewer, the modern map-making tool in ArcGIS Enterprise. To learn more, see Find by Attributes and Location.

Find Existing Locations The Find Existing Locations tool selects features in your study area that meet a series of criteria based on spatial or attribute queries.

Workflow diagram

Find Existing Locations workflow diagram

Terminology

TermDescription

Spatial Query

A query on spatial relationships

Attribute Query

A query on field values

Examples

  • An investment firm has purchased a small chain of grocery stores and is looking for a location for their new distribution center. Their distribution center will require a vacant lot that is at least 20 acres, is located within 1 mile of a highway, and is not located in a flood zone. They can use Find Existing Locations to select all of the lots in a city that fit these criteria.

  • A GIS analyst is performing a preliminary review of wind farm applications to determine which proposals should be submitted for further assessment. Her criteria are that the proposals must have road access and cannot be on or within view of protected areas. She can use Find Existing Locations to select the sites that meet all of the criteria.

  • A city's police department is conducting an analysis to determine if there is a relationship between violent crimes and unemployment rates. An expanded summer job program will be implemented for high schools in areas where there is high violent crime and high unemployment. They can use Find Existing Locations to select high schools within a quarter mile of the remediation areas.

Usage notes

A single input of point, line, or area features is required. The input is the only layer that you can query unless another layer is added through a spatial join.

You can build a query using Add Expression. You can add multiple expressions, including a combination of spatial and attribute queries. The features from the input layer that satisfy the expression are written to the result layer.

There are several operators that you can use for an attribute query, depending on whether the field you are querying is categorical or numerical.

If your field is categorical, you can use the following operators:

  • is
  • is not
  • starts with
  • ends with
  • contains
  • does not contain
  • is blank
  • is not blank

If your field is numerical, you can use the following operators:

  • is
  • is not
  • is at least
  • is less than
  • is at most
  • is greater than
  • is between
  • is not between
  • is blank
  • is not blank

For more information on building attribute expressions, see the How Find Existing Locations works section.

You can use the following spatial expressions in a spatial query:

  • intersects
  • does not intersect
  • within a distance of
  • not within a distance of
  • completely contains
  • does not completely contain
  • completely within
  • not completely within
  • nearest to

For more information on building spatial queries, see the How Find Existing Locations works section.

You can add multiple expressions to the query using the Add Expression button. You can combine the expressions using either and or or as an operator.

If Use current map extent is checked, only the features in the input layer that are visible within the current map extent will be analyzed. If unchecked, all features will be analyzed, even if they are outside the current map extent.

How Find Existing Locations works

Find Existing Locations uses spatial and attribute expressions to query layers. In this section, you will learn how to build an expression, review the available spatial expression types, learn how to group expressions together in a query, and view an example of a completed query.

Build expressions

To build an expression, click the Add Expression button to open the Add Expression dialog box.

Attribute expressions

Attribute expressions are created using where (attribute query) as the expression type.

Add Attribute expression example
Use the Add Expression dialog box for attribute expression.

NumberDescription
Input layer

Layers you can use in the expression are listed here. Initially, the only choice will be the analysis layer. Once you establish a spatial relationship to other layers (for example, Parcels completely within City Boundaries), the other layers will be listed in the drop-down menu.

Expression type

This is the expression type. For attribute expressions, choose where (attribute query).

Field

Choose the field you want to query against from the list.

Operator

Choose an operator for the expression.

Value, Field, or Unique value

  • If you want to find features based on a specific value, choose Value and enter a value in the input box.
  • If you want to compare the value in one field with the value in another field, choose Field, click the drop-down arrow, and choose the field for your expression. For example, in the screen capture above, features where the value of POP UNDER 18 is greater than the value of POP OVER 18 will be found.
  • If you want to find features based on a specific value in the field you've selected for your expression, choose Unique and select a unique value from your field. Unique value filters require feature services that are published using ArcGIS Pro or ArcGIS 10.1 for Desktop or later.

Note:

If any of your layers has a filter applied, only those features that meet the filter expression are used in the analysis.

Spatial expressions

Spatial expressions are created by choosing expression types such as completely within or intersects (you can find the complete list in the Spatial expression types section).

When you choose a spatial expression type, the Add Expression dialog box changes depending on the expression type you choose.

Spatial Expression
Use the Add Expression dialog box for spatial expression.

NumberDescription
First layer

The first layer. Initially, the only choice will be the analysis layer. Once you establish a spatial relationship to other layers (for example, Parcels completely within Community Boundaries), the other layers are listed in the drop-down menu.

Expression type

The spatial expression type. See below for details about each of the spatial expression types.

Second layer

The second layer. These are the other layers in your map.

Spatial expression types

A spatial expression establishes a relationship between two layers. If you need to establish a spatial relationship between features in the same layer (for example, you want to select vacant parcels within a distance of industrial parcels), copy the parcels layer and add it to your map so that you have two layers using the same parcel features.

Within a distance of and Not within a distance of

Within a distance of

The within a distance relationship uses the straight-line distance between features in the first layer to those in the second layer.

  • Within a distance of—A feature in the first layer is selected (included in the output) if any part is within the specified distance of a feature in the second layer; for example, parcels within 100 meters of a river will be included in the output.
  • Not within a distance of—A feature in the first layer is excluded (not included in the output) if it is within a distance of another feature; for example, parcels within 100 meters of a river will not be included in the output. You can think of this relationship as the feature is farther away than the specified distance.

Note:

Distances are calculated between the closest parts of features. In the example above, where parcels had to be within 0.75 miles of the Los Angeles River, parcels are selected if any part of the parcel is within 0.75 miles. If the criteria is that the entire parcel must be within 0.75 miles, use the Create Buffers tool with a distance of 0.75 miles around the Los Angeles River to create a new layer. You can then create an expression where parcels are completely within the buffer layer.

Completely contains and Does not completely contain

Completely contains

A feature in the first layer passes this test if it completely surrounds a feature in the second layer. No portion of the contained feature can be outside the containing feature; however, the contained feature is allowed to touch the containing feature (that is, share a common point along its boundary).

  • Completely contains—If a feature in the first layer contains a feature in the second layer, the feature in the first layer is included in the output.
  • Does not completely contain—If a feature in the first layer contains a feature in the second layer, the feature in the first layer is excluded from the output.

Note:

You can use the contains relationship with points and lines. For example, you have a layer of street centerlines (lines) and a layer of manhole covers (points), and you want to find streets that contain a manhole cover. You could use completely contains to find streets that contain manhole covers, but for a line to contain a point, the point must be exactly on the line (that is, in GIS terms, they are snapped to each other). If there is any doubt about this, use the within a distance of relationship with a suitable distance value.

Completely within and Not completely within

Completely within

A feature in the first layer passes this test if it is completely surrounded by a feature in the second layer. The entire feature in the first layer must be within the containing feature; however, the two features are allowed to touch (that is, share a common point along its boundary).

  • Completely within—If a feature in the first layer is completely within a feature in the second layer, the feature in the first layer is included in the output.
  • Not completely within—If a feature in the first layer is completely within a feature in the second layer, the feature in the first layer is excluded from the output.

Note:

You can use the within relationship for points and lines, just as you can with the contains relationship. For example, your first layer contains points representing manhole covers and you want to find the manholes that are on street centerlines (as opposed to parking lots or other non-street features). You can use completely within to find manhole points within street centerlines, but for a point to contain a line, the point must be exactly on the line (that is, in GIS terms, they are snapped to each other). If there is any doubt about this, use the within a distance of relationship with a suitable distance value.

Intersects and Does not intersect

Intersects

A feature in the first layer passes the intersects test if it overlaps any part of a feature in the second layer, including touches (where features share a common point).

  • Intersects—If a feature in the first layer intersects a feature in the second layer, the feature in the first layer is included in the output.
  • Does not intersect—If a feature in the first layer intersects a feature in the second layer, the feature in the first layer is excluded from the output.

Nearest to

Nearest to

A feature in the first layer passes this test if it is nearest to a feature in the second layer.

  • Nearest to—If a feature in the first layer is nearest to a feature in the second layer, the feature in the first layer is included in the output.

Grouping

You can group two or more consecutive expressions together using the group button group. Select multiple expressions to group using Shift+click.

Here is an example where grouping is needed:

  • You have a point layer of sites containing toxic chemicals. Each point has an attribute, CHEMICAL, containing the name of the toxic chemical known to exist at the site.
  • You want to find toxic sites containing MERCURY or SELENIUM that are near a river.
  • You also want to find toxic sites containing BENZENE or LEAD that are near a park.

In the above example, two sets of features are created from the same toxic sites layer: toxic sites near parks and toxic sites near rivers. These two sets are distinct from each other.

Since the set of toxic sites near a river is distinct from the toxic sites near a park, use grouping to construct the query. Figure 1 shows the initial query without any grouping or modification of logical operators (they are all and). This query results in toxic sites within a kilometer of both a park and a river. This is not the goal; the desired result is one set of toxic sites within a kilometer of a river and another distinct set within a kilometer of a park.

Initial query
Figure 1: Initial query

To construct a query that meets the criteria outlined above, create groups. Each group forms a subquery whose results are combined with the previous expression.

Start by selecting the first two attribute expressions, as shown in Figure 2.

Select the first group of attribute expressions
Figure 2: Select the first group of attribute expressions.

After selecting the two attribute expressions, click the group button group. The group becomes indented, as shown in Figure 3.

Select the second group of attribute expressions, as shown in Figure 3.

Select the next group of attribute expressions
Figure 3: Select the second group of attribute expressions.

After selecting the second group, click the group button.

Finally, select the second group of attribute expressions and the spatial expression to which they belong, as shown in Figure 4.

Select the second group of attribute expressions and the spatial expression to which they belong
Figure 4: Select the second group of attribute selections and the spatial expression to which they belong.

Click the group button and the query becomes indented, as shown in Figure 5. The final step is to switch and to or, as shown in Figure 5.

The final query
Figure 5: The final query

The query shown in Figure 5 yields the desired results.

  • Toxic Sites with LEAD or BENZENE are found and these features are subset by finding those within one kilometer of Parks.
  • Next, Toxic Sites with SELENIUM or MERCURY are found and these features are subset by finding those within one kilometer of the River.
  • Finally, the two sets of features are combined using a logical or.

Grouping expressions is only necessary when you need to create two or more distinct sets of features from the same layer. One way to think of grouping is that without grouping, you would have to execute Find Existing Locations twice, once to find sites near rivers and again to find sites near parks. You would then need to use the Merge tool to combine the two results.

You can click the text button text to view a textual representation of the query. The textual representation uses parentheses to denote groups.

Example of a completed query

The following example is looking for vacant parcels in the city of Los Angeles suitable for developing public parks. The criteria for a suitable park site include the following:

  • The parcel must be vacant.
  • It must be within the Los Angeles city limits.
  • It must be greater than one acre in size.
  • Some part of the parcel must be within 0.75 miles of the Los Angeles river.
  • The parcel must be at least 0.25 miles from existing parks.

The following screen capture shows a Find Existing Locations query based on the above criteria using layers named Parcels, Rivers, and City Boundaries:

Query to find parcels

Note:

  • The order of the expressions does not affect the result of the analysis.
  • You can group and ungroup expressions by clicking the group and ungroup buttons group and ungroup. To create groups, select two or more expressions and click the group button. For more information about groups, see the Grouping topic in How Find Existing Locations works.
  • Clicking and switches the operator to or. Clicking or switches the operator to and.

Similar tools

Use Find Existing Locations to select features that meet a series of criteria with attribute and spatial queries. Other tools may be useful in solving similar but slightly different problems.

Map Viewer Classic analysis tools

If you are trying to find locations that are similar to a reference location, use the Find Similar Locations tool.

If you are trying to use a query to create features, use the Derive New Locations tool.

Note:

The main difference between the Find Existing Locations tool and the Derive New Locations tool is that the result of Derive New Locations can contain partial features.

  • In both tools, the attribute expression where and the spatial expressions completely within and completely contains return the same result because the expressions return entire features.
  • When intersects or within a distance of is used, Derive New Locations creates new features in the output result layer.

ArcGIS Pro analysis tools

Find Existing Locations performs the function of Select Layer by Attribute and Select Layer by Location in ArcGIS Pro.