Étiquette | Explication | Type de données |
Input Features | The polygon features that will be used to create the centerline. | Feature Layer |
Output Feature Class | The output feature class for the centerlines. | Feature Class |
Connecting Features (Facultatif) | The features that will be used to ensure connectivity of the centerline with other features in a network. The centerline will link to the point or the shared boundary wherever a feature from a connecting feature class touches the input feature. | Feature Layer |
Synthèse
Creates centerlines from polygon features. This tool is useful for creating centerlines from hydrographic polygons for use at smaller scales.
Illustration
Utilisation
The Output Feature Class parameter value must be a feature class in a geodatabase. Shapefiles are not supported.
-
This tool is optimized for spatial relationships and junctions typically found in a hydrographic network. Examples of these are long, thin polygons such as rivers or canals. This tool is also optimized for junctions that occur on the same elevation, such as when rivers converge. However, the tool does not handle junctions that occur on different levels, such as when highway overpasses cross over one another.
-
For best results, run the Dissolve tool to dissolve touching polygon features before running Polygon To Centerline. While this tool checks spatial relationships between the input features to ensure centerlines connect when input features touch, running dissolve first may achieve a cleaner result.
-
The integrity of the output relies on the topological integrity of the inputs. The following are input data requirements and suggestions:
- Empty or null geometry—The Input Features parameter value must consist of valid geometries. If necessary, use the Repair Geometry tool to repair the features.
- Overlapping geometries—The connecting features hidden behind input features may generate visually impaired centerlines.
- Nonlinear segments—Bézier curve, circular arc, and elliptic arc segments may compromise the quality of the results.
The output centerlines will not contain any geographic attributes from the input polygon features. A field named FID will be added to the Output Feature Class parameter value. This field is populated with the ObjectID of the polygon from which the centerline was created, which can be used to join the centerlines to the input polygons. If a tool such as Dissolve or Eliminate Polygon Part was run on the original polygons to prepare the data before running Polygon To Centerline, the FID field will link to the prepared polygons, not the original polygons. The Identity tool can be run using the original polygons to split the centerlines and identify the original polygon that contains the centerline.
The output will include a field named FID_[input feature class name]. If the centerline touches a feature in the input feature class that is not the feature used to create the centerline, the field will be populated with the ObjectID of the touching input feature. If the centerline does not touch any other input features, the value in the field will be NULL.
The output will include a field for each feature class provided for the Connecting Features parameter. The field will be named FID_[connecting feature class name]. If the centerline touches a feature in the connecting feature class, the field will be populated with the ObjectID of the touching feature. If the centerline does not touch any connecting features, the value in the field will be NULL.
-
For best results, run the Eliminate Polygon Part tool first to remove small holes in the polygon features, for example, to remove holes from the middle of river polygons where island polygons exist. If a hole exists in the polygon, the centerline will branch around the hole, potentially creating two short centerline segments. Filling small holes before running Polygon To Centerline will create a single centerline through the section where a hole previously existed.
The tool applies an adaptive densification to the input features to improve centerline quality. Although it is not necessary to densify input features before running this tool, simplifying input geometries may speed up the process due to the reduced number of vertices.
Flow direction will be honored only for the connecting line features. If there are none, the flow direction will follow the longest path starting at an end point.
In addition to connecting features, the tool will use the input features to identify whether any of them are touching each other and can be used to refine the centerlines.
-
The tool may not honor touch points if the input and connecting features have different coordinate systems.
The output will only contain single-part geometries. Centerlines will be split at the junctions, and each path will be written as a separate feature to the output table.
Paramètres
arcpy.topographic.PolygonToCenterline(in_features, out_feature_class, {connecting_features})
Nom | Explication | Type de données |
in_features | The polygon features that will be used to create the centerline. | Feature Layer |
out_feature_class | The output feature class for the centerlines. | Feature Class |
connecting_features [connecting_features,...] (Facultatif) | The features that will be used to ensure connectivity of the centerline with other features in a network. The centerline will link to the point or the shared boundary wherever a feature from a connecting feature class touches the input feature. | Feature Layer |
Exemple de code
The following stand-alone sample script demonstrates how to use the PolygonToCenterline function to create a centerline from a polygon feature.
# Name: PolygonToCenterline_sample.py
# Description: Select the rivers and produce centerlines
# Import System Modules
import arcpy
# Check Out Extensions
arcpy.CheckOutExtension('Foundation')
# Setting Local Variables
in_features = r'C:\data\CTM.gdb\CTM\HydrographySrf'
out_feature_class = r'C:\data\CTM.gdb\CTM\HydrographyCrvOut'
# Select only the Rivers subtype
inputLyr = arcpy.management.MakeFeatureLayer(in_features, "inputLyr", "FCSubtype = 100314")
# Execute Polygon To Centerline
arcpy.topographic.PolygonToCenterline(inputLyr, out_feature_class)
# Check In Extensions
arcpy.CheckInExtension("Foundation")
Environnements
Informations de licence
- Basic: Non
- Standard: Nécessite Production Mapping
- Advanced: Nécessite Production Mapping
Rubriques connexes
Vous avez un commentaire à formuler concernant cette rubrique ?