com.esri.arcgis.geoprocessing.tools.datamanagementtools
Class PolygonToLine
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.datamanagementtools.PolygonToLine
- All Implemented Interfaces:
- GPTool
public class PolygonToLine
- extends AbstractGPTool
Creates a feature class containing lines that are converted from polygon boundaries or generated by splitting polygon boundaries at their intersections; each output line carries the left and right input polygon feature IDs.
The Polygon To Line tool is contained in the Data Management Tools tool box.
Usage tips:
- The attributes of the input features will not be maintained in the output feature class. Two new fields, LEFT_FID and RIGHT_FID, will be added to the output feature class and set to the feature IDs of the input polygons to the left and right of each line.
- Where input polygon boundaries touch or overlap each other at locations other than their start and end vertices, they will be split at those intersections; each of the split lines will become an output line feature. If an input polygon boundary is not intersected by another feature, its entire shape will still be written out as a line feature.
- For multipart input features, the output lines will be singlepart.
- For parametric (true) curve input features, the output lines will remain true curves even if they are split. This does not apply to shapefile data.
- In a polygon geometry, the outer boundary is always written in a clockwise direction, therefore, for a polygon with no adjacent neighbors the resulting output line will have a value of -1 for its LEFT_FID, indicating no polygon to the left side of it. If a polygon has a hole, the inner boundary is always written in a counterclockwise direction, therefore, the resulting output line will also have a value of -1 for its LEFT_FID, indicating no polygon to the left side of it (inside the hole). Both output lines will have the polygon feature ID as the RIGHT_FID. When polygons have shared boundaries, the output lines representing the shared boundaries and field values will be as follows:
- If a polygon contains another polygon, one output line in the clockwise direction will be generated representing the shared boundary, with its LEFT_FID set to the outer polygon feature ID and the RIGHT_FID set to the inner polygon feature ID.
- If a polygon is adjacent to another polygon, one output line will be generated representing the shared boundary. The line direction will be arbitrary; the LEFT_FID and the RIGHT_FID will be set to the left or right polygon feature IDs accordingly.
- If a polygon overlaps another polygon, two output lines will be generated representing each crossing boundary twice: the first line will represent the outer boundary of one of the overlapping polygons, therefore, its LEFT_FID is the feature ID of the polygon it crosses and its RIGHT_FID will be its own polygon feature ID; the second line will be in the opposite direction, splitting the other polygon, therefore, its LEFT_FID and RIGHT_FID will be the same as the other polygon feature ID.
From the output feature class, it is easy to identify shared or overlapping boundary lines: their LEFT_FID is not -1.
Constructor Summary |
PolygonToLine()
Creates the Polygon To Line tool with defaults. |
PolygonToLine(java.lang.Object inFeatures,
java.lang.Object outFeatureClass)
Creates the Polygon To Line tool with the required parameters. |
Method Summary |
java.lang.Object |
getInFeatures()
Returns the Input Features parameter of this tool . |
java.lang.String |
getLeftRightOption()
Returns the Provide left-right neighbor information parameter of this tool . |
java.lang.Object |
getOutFeatureClass()
Returns the Output Feature Class parameter of this tool . |
java.lang.String |
getToolboxAlias()
Returns the alias of the tool box containing this tool. |
java.lang.String |
getToolboxName()
Returns the name of the tool box containing this tool. |
java.lang.String |
getToolName()
Returns the name of this tool. |
void |
setInFeatures(java.lang.Object inFeatures)
Sets the Input Features parameter of this tool . |
void |
setLeftRightOption(java.lang.String leftRightOption)
Sets the Provide left-right neighbor information parameter of this tool . |
void |
setOutFeatureClass(java.lang.Object outFeatureClass)
Sets the Output Feature Class parameter of this tool . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PolygonToLine
public PolygonToLine()
- Creates the Polygon To Line tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
PolygonToLine
public PolygonToLine(java.lang.Object inFeatures,
java.lang.Object outFeatureClass)
- Creates the Polygon To Line 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
- the input features that must be polygon.outFeatureClass
- the output line feature class.
getInFeatures
public java.lang.Object getInFeatures()
- Returns the Input Features parameter of this tool .
This parameter is the input features that must be polygon.
This is a required parameter.
- Returns:
- the Input Features
setInFeatures
public void setInFeatures(java.lang.Object inFeatures)
- Sets the Input Features parameter of this tool .
This parameter is the input features that must be polygon.
This is a required parameter.
- Parameters:
inFeatures
- the input features that must be polygon.
getOutFeatureClass
public java.lang.Object getOutFeatureClass()
- Returns the Output Feature Class parameter of this tool .
This parameter is the output line feature class.
This is a required parameter.
- Returns:
- the Output Feature Class
setOutFeatureClass
public void setOutFeatureClass(java.lang.Object outFeatureClass)
- Sets the Output Feature Class parameter of this tool .
This parameter is the output line feature class.
This is a required parameter.
- Parameters:
outFeatureClass
- the output line feature class.
getLeftRightOption
public java.lang.String getLeftRightOption()
- Returns the Provide left-right neighbor information parameter of this tool .
This is an optional parameter.
- Returns:
- the Provide left-right neighbor information
setLeftRightOption
public void setLeftRightOption(java.lang.String leftRightOption)
- Sets the Provide left-right neighbor information parameter of this tool .
This is an optional parameter.
- Parameters:
leftRightOption
- null
getToolName
public java.lang.String getToolName()
- Returns the name of this tool.
- Returns:
- the tool name
getToolboxName
public java.lang.String getToolboxName()
- Returns the name of the tool box containing this tool.
- Returns:
- the tool box name
getToolboxAlias
public java.lang.String getToolboxAlias()
- Returns the alias of the tool box containing this tool.
- Returns:
- the tool box alias