Skip To Content

Find Closest

Note:

Find Closest was named Find Nearest in Map Viewer Classic.

The Find Closest tool uses either a line distance or a travel mode to measure between input features and near features. For each input feature, the specified number of near features is ranked by distance from the input feature.

The output is a hosted feature layer.

Example

The director of Safety Services wants to determine which fire station in the city is closest to each of the schools in terms of driving time. The director wants to use this information, which can be collected using Find Closest, to set primary and secondary responder stations for each school in case of an emergency.

Closest fire stations to schools

Usage notes

Find Closest includes configurations for input layers, analysis settings, and result layers.

Input layers

The Input layers group includes the following parameters:

  • Input layer is used to select the layer for which the closest features are found.

    When lines or polygons are used as inputs, the closest location is found using the distance from or to the closest point along the line or on the boundary of the polygon.
  • Near layer is used to select the layer from which features are found based on their proximity to the input layer.
  • Optional barrier layers is used to add features that act as temporary restrictions when traveling on the underlying streets. The Optional barrier layers parameter includes the following subparameters:
    • Point barrier layer—Point features that block traffic at a specific position along the street. Travel is permitted on the street but not through the barrier. Examples of point barriers include a fallen tree, a traffic accident, or a downed electrical line.
    • Line barrier layer—Line features that block traffic across several street segments. The line barriers prohibit travel anywhere the barriers intersect the streets. Examples of line barriers include a parade or protest.
    • Polygon barrier layer—Polygon features that block traffic across entire areas of the street network. The polygon barriers prohibit travel anywhere the polygon intersects the street. Examples of polygon barriers include a flood or forest fire.

Analysis settings

The Analysis settings group includes the following parameters:

  • Measurement type is used to choose the measurement by which the closest features are found. The method can be Line distance or a travel mode.

    Find Closest uses a geodesic method when finding features with a straight-line distance rather than a Euclidean method. Geodesic lines account for the actual shape of the earth (an ellipsoid, or more properly, a geoid). Distances are calculated between two points on a curved surface (the geoid) as opposed to two points on a flat surface (the Cartesian plane).

    Travel modes are only available if you have the network analysis privilege and point features are used as the inputs.

    Learn more about travel modes
  • Departure time specifies the date and time when travel begins to find closest features. This parameter impacts the travel speed for time-based travel modes and impacts the time accumulation for distance-based travel modes. The Departure time parameter options are as follows:
    • Now—Traffic conditions will be based on the current date and time. Live traffic conditions will be used when available.
    • Custom date and time—Traffic conditions will be based on the specified date and time. If the custom date and time is within four hours of the current time, live traffic conditions will be used. If the custom date and time is not within four hours of the current date and time, average historical traffic conditions for the day of week and time of day will be used. Use this option to perform analysis with typical traffic conditions. For example, choose 9:00 a.m. on the previous Monday to perform analysis with typical conditions for Mondays at 9:00 a.m.
    • Time unspecified—Travel speeds will be based on average historical speeds or the posted speed limit.
  • Limit the number of closest locations is used to determine whether a custom maximum number of closest locations is used by the tool. If enabled, Max number of closest locations to find per input is available. This parameter is enabled by default.
  • Max number of closest locations to find per input is used to specify the maximum number of closest locations that can be returned for each input feature. This parameter is available if Limit the number of closest locations is enabled.
  • Limit the search range is used to determine whether a custom maximum search range is used by the tool. If enabled, Max search range is available. If not enabled, the search range is unlimited.

    When a limit is set on the search range, it's possible that the tool won't find any nearest locations within that range, or that fewer locations are found than the maximum number of nearest locations you specify.
  • Max search range and Max search range (minutes) determine the maximum distance or time required to travel between the input points and the points returned as closest features. Features outside of the search range will not be returned. This parameter is available if Limit the search range is enabled.
  • Search range units is used to select the distance units (miles, kilometers, meters, feet, or yards) for measuring the maximum search range for distance-based measurement types.

Result layers

The Result layers group includes the following parameters:

  • Output name determines the name of the layer that is created and added to the map. The name must be unique. If a layer with the same name already exists in your organization, the tool will fail and you will be prompted to use a different name.
  • Include route layers saves each result route as a route layer. A route layer includes all the information for a particular route, such as the stops assigned to the route and the travel directions. Creating route layers is useful if you want to share the individual routes with other members in your organization. Click the individual result route on the map to open a pop-up with options to edit, open the route layer, or zoom to the route. The Open route option in the pop-up adds the route layer to the current map.
  • Save in folder specifies the name of a folder in My Content where the result will be saved.

Limitations

The following limitations apply to the tool:

  • Travel modes are only enabled when point features are used as inputs.
  • The processing time is dependent on the number of start locations, the number of near locations, and the maximum search range.
  • The maximum number of route layers that can be created is 1,000. If the result contains more than 1,000 routes and Include route layers is checked, only the output feature service will be created.
  • An error will occur if the tool takes more than 240 minutes to run when using travel modes. If this error occurs, try rerunning the analysis with fewer input features or increase the routing geoprocessing service's usage timeout.

Environments

Analysis environment settings are additional parameters that affect a tool's results. You can access the tool's analysis environment settings from the Environment settings parameter group.

This tool honors the following analysis environments:

  • Output coordinate system
  • Processing extent
    Note:

    The default processing extent in Map Viewer is Full extent. This default is different from Map Viewer Classic in which Use current map extent is enabled by default.

Credits

Credits will be consumed if your ArcGIS Enterprise portal is configured to use the ArcGIS Online routing services and a travel mode is chosen for Measurement type.

For more information, see Understand credits for spatial analysis.

Outputs

This tool includes the following outputs:

  • One layer with the closest features. The geometry of the output depends on the geometry of the near features.
  • One line layer with the lines connecting the input features to the closest features.
  • One route layer per line (optional).

Licensing requirements

This tool requires the following licensing and configurations:

  • Creator or GIS Professional user type
  • Publisher or Administrator role, or an equivalent custom role

The following licensing and routing services are required to use travel modes:

  • Network Analysis privilege
  • Closest Facility (Asynchronous)
  • Routing utility service

Learn more about configuring routing services

Resources

Use the following resources to learn more: