Near (Coverage)

License Level:BasicStandardAdvanced

Summary

Computes the distance from each point in a coverage to the nearest arc, point, or node in another coverage.

Illustration

Near illustration

Usage

Syntax

Near_arc (in_cover, near_cover, out_cover, {feature_type}, {search_radius}, {location})
ParameterExplanationData Type
in_cover

The coverage containing points from which distances are calculated to each closest arc, point, or node in the <near_cover:>.

Coverage
near_cover

The line or point coverage whose features are used to calculate distances from each input cover point. This must be different from the input cover.

Coverage
out_cover

The coverage to be created. The <input_cover> is copied to the <output_cover:>, then NEAR is performed on the <output_cover:>.

Coverage
feature_type
(Optional)

The type of feature that will be searched from points to find the nearest feature and calculate the distance between them.

  • LINEA point-to-arc distance will be determined. New items for distance and the internal number of the closest arc in the <near_cover:> will be added to the <input_cover> PAT. This is the default option.
  • POINTA point-to-point distance will be determined. New items for distance and the internal number of the closest point in the <near_cover:> will be added to the <input_cover> PAT.
  • NODEA point-to-node distance will be determined. New items for distance and the internal node number of the closest node in the <near_cover:> will be added to the <input_cover> PAT.
String
search_radius
(Optional)

The maximum distance in coverage units between input cover features and near cover features for which distance and near cover internal number will be determined.

If no near cover feature is within the search radius of a given input cover point or line, both the internal number and distance output by NEAR will be zero.

The default search radius is the width or height of the near coverage BND divided by 100, whichever is larger. This default search radius is used whenever the search radius argument is set to zero or skipped.

Double
location
(Optional)

Determines whether the x,y coordinates of the "nearest point" of the closest arc, point, or node are to be saved as well as the cover# and distance. The new items are X-COORD and Y-COORD.

  • NO_LOCATIONThe x,y coordinates of the nearest point are not saved. This is the default.
  • LOCATIONThe x,y coordinates of the nearest point, as well as the cover# and distance, will be saved.
Boolean

Code Sample

Near example (stand-alone script)

The following stand-alone script demonstrates how to calculate the distances between wells in one coverage and roads in another.

# Name: Near_Example.py
# Description: Computes the distances between wells and roads
# Requirements: ArcInfo Workstation

# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"

# Set local variables
inCover = "wells142"
nearCover = "road"
outCover = "C:/output/nearwells"
featureType = "LINE"
searchRadius = 12000
location = "LOCATION"

# #Execute Near
arcpy.Near_arc(inCover, nearCover, outCover, featureType, 
               searchRadius, location)

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: No
ArcGIS for Desktop Standard: No
ArcGIS for Desktop Advanced: Requires ArcInfo Workstation installed
6/18/2012