com.esri.arcgis.geoprocessing.tools.analysistools
Class Near

java.lang.Object
  extended by com.esri.arcgis.geoprocessing.AbstractGPTool
      extended by com.esri.arcgis.geoprocessing.tools.analysistools.Near
All Implemented Interfaces:
GPTool

public class Near
extends AbstractGPTool

Determines the distance from each feature in the Input Features to the nearest features in the Near Features, within the Search Radius. The Near tool is contained in the Analysis Tools tool box.
Learn more about how Near works

Software restrictions: ArcInfo only

Illustration:

Usage tips:


Field Summary
 
Fields inherited from class com.esri.arcgis.geoprocessing.AbstractGPTool
vals
 
Constructor Summary
Near()
          Creates the Near tool with defaults.
Near(Object inFeatures, Object nearFeatures)
          Creates the Near tool with the required parameters.
 
Method Summary
 String getAngle()
          Returns the Angle parameter of this tool .
 Object getInFeatures()
          Returns the Input Features parameter of this tool .
 String getLocation()
          Returns the Location parameter of this tool .
 Object getNearFeatures()
          Returns the Near Features parameter of this tool .
 Object getOutFeatureClass()
          Returns the Output Feature Class parameter of this tool (Read only).
 Object getSearchRadius()
          Returns the Search Radius parameter of this tool .
 String getToolboxAlias()
          Returns the alias of the tool box containing this tool.
 String getToolboxName()
          Returns the name of the tool box containing this tool.
 String getToolName()
          Returns the name of this tool.
 void setAngle(String angle)
          Sets the Angle parameter of this tool .
 void setInFeatures(Object inFeatures)
          Sets the Input Features parameter of this tool .
 void setLocation(String location)
          Sets the Location parameter of this tool .
 void setNearFeatures(Object nearFeatures)
          Sets the Near Features parameter of this tool .
 void setSearchRadius(Object searchRadius)
          Sets the Search Radius parameter of this tool .
 
Methods inherited from class com.esri.arcgis.geoprocessing.AbstractGPTool
getParameterValues, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Near

public Near()
Creates the Near tool with defaults.

Initializes the array of tool parameters with the default values specified when the tool was created.


Near

public Near(Object inFeatures,
            Object nearFeatures)
Creates the Near tool with the required parameters.

Initializes the array of tool parameters with the values as specified for the required parameters and with the default values for the other parameters.

Parameters:
inFeatures - Feature Layer, the feature class or layer containing features from which distances are calculated to each feature in the Near Features.
nearFeatures - Feature Layer, the feature class or layer containing features from which distances are calculated to the closest feature in the Input Features. If multiple feature classes or layers are specified, an extra field named NEAR_FC will be added to the input feature class to identify which near feature class contains the closest feature.
Method Detail

getInFeatures

public Object getInFeatures()
Returns the Input Features parameter of this tool . This parameter is Feature Layer, the feature class or layer containing features from which distances are calculated to each feature in the Near Features. This is a required parameter.

Returns:
the Input Features

setInFeatures

public void setInFeatures(Object inFeatures)
Sets the Input Features parameter of this tool . This parameter is Feature Layer, the feature class or layer containing features from which distances are calculated to each feature in the Near Features. This is a required parameter.

Parameters:
inFeatures - Feature Layer, the feature class or layer containing features from which distances are calculated to each feature in the Near Features.

getNearFeatures

public Object getNearFeatures()
Returns the Near Features parameter of this tool . This parameter is Feature Layer, the feature class or layer containing features from which distances are calculated to the closest feature in the Input Features. If multiple feature classes or layers are specified, an extra field named NEAR_FC will be added to the input feature class to identify which near feature class contains the closest feature. This is a required parameter.

Returns:
the Near Features

setNearFeatures

public void setNearFeatures(Object nearFeatures)
Sets the Near Features parameter of this tool . This parameter is Feature Layer, the feature class or layer containing features from which distances are calculated to the closest feature in the Input Features. If multiple feature classes or layers are specified, an extra field named NEAR_FC will be added to the input feature class to identify which near feature class contains the closest feature. This is a required parameter.

Parameters:
nearFeatures - Feature Layer, the feature class or layer containing features from which distances are calculated to the closest feature in the Input Features. If multiple feature classes or layers are specified, an extra field named NEAR_FC will be added to the input feature class to identify which near feature class contains the closest feature.

getSearchRadius

public Object getSearchRadius()
Returns the Search Radius parameter of this tool . This parameter is Linear unit, the maximum distance between Input Features and Near Features for which distance and FID will be determined. If no Search Radius is specified, all Near Features will be used. This is an optional parameter.

Returns:
the Search Radius

setSearchRadius

public void setSearchRadius(Object searchRadius)
Sets the Search Radius parameter of this tool . This parameter is Linear unit, the maximum distance between Input Features and Near Features for which distance and FID will be determined. If no Search Radius is specified, all Near Features will be used. This is an optional parameter.

Parameters:
searchRadius - Linear unit, the maximum distance between Input Features and Near Features for which distance and FID will be determined. If no Search Radius is specified, all Near Features will be used.

getLocation

public String getLocation()
Returns the Location parameter of this tool . This parameter is String, determines whether the x,y coordinates of the nearest feature are added to the Input Features, as well as NEAR_FID and NEAR_DIST. The new fields are NEAR_X and NEAR_Y. This is an optional parameter.

Returns:
the Location

setLocation

public void setLocation(String location)
Sets the Location parameter of this tool . This parameter is String, determines whether the x,y coordinates of the nearest feature are added to the Input Features, as well as NEAR_FID and NEAR_DIST. The new fields are NEAR_X and NEAR_Y. This is an optional parameter.

Parameters:
location - String, determines whether the x,y coordinates of the nearest feature are added to the Input Features, as well as NEAR_FID and NEAR_DIST. The new fields are NEAR_X and NEAR_Y.

getAngle

public String getAngle()
Returns the Angle parameter of this tool . This parameter is String, determines whether the angle between the near feature will calculated, and stored into the NEAR_ANGLE field. The angle value is measured in degrees, where one degree represents 1/360 of a circle, and fractions of a degree are represented as decimal points. Angles are measured from 180 to -180; 0 to the east, 90 to the north, 180 (-180) to the west, and -90 to the south. This is an optional parameter.

Returns:
the Angle

setAngle

public void setAngle(String angle)
Sets the Angle parameter of this tool . This parameter is String, determines whether the angle between the near feature will calculated, and stored into the NEAR_ANGLE field. The angle value is measured in degrees, where one degree represents 1/360 of a circle, and fractions of a degree are represented as decimal points. Angles are measured from 180 to -180; 0 to the east, 90 to the north, 180 (-180) to the west, and -90 to the south. This is an optional parameter.

Parameters:
angle - String, determines whether the angle between the near feature will calculated, and stored into the NEAR_ANGLE field. The angle value is measured in degrees, where one degree represents 1/360 of a circle, and fractions of a degree are represented as decimal points. Angles are measured from 180 to -180; 0 to the east, 90 to the north, 180 (-180) to the west, and -90 to the south.

getOutFeatureClass

public Object getOutFeatureClass()
Returns the Output Feature Class parameter of this tool (Read only). This is an derived parameter.

Returns:
the Output Feature Class

getToolName

public String getToolName()
Returns the name of this tool.

Returns:
the tool name

getToolboxName

public String getToolboxName()
Returns the name of the tool box containing this tool.

Returns:
the tool box name

getToolboxAlias

public String getToolboxAlias()
Returns the alias of the tool box containing this tool.

Returns:
the tool box alias