Label | Explanation | Data Type |
Input Features | The input features, which can be multipoint, line, polygon, or annotation. | Feature Layer |
Output Feature Class | The output point feature class. | Feature Class |
Inside (Optional) | Specifies whether an output point will be located within the input feature or at the centroid of the input feature.
If the Inside parameter is not checked, the location of each output point will be determined as follows:
If the Inside parameter is checked, the location of the representative point of an input feature will be contained by the input feature and determined as follows:
| Boolean |
Summary
Creates a feature class containing points generated from the centroids of the input features or placed within the input features.
Illustration
Usage
The attributes of the input features will be maintained in the output feature class. A new field, ORIG_FID, will be added to the output feature class and set to the input feature IDs.
Parameters
arcpy.management.FeatureToPoint(in_features, out_feature_class, {point_location})
Name | Explanation | Data Type |
in_features | The input features, which can be multipoint, line, polygon, or annotation. | Feature Layer |
out_feature_class | The output point feature class. | Feature Class |
point_location (Optional) | Specifies whether an output point will be located within the input feature or at the centroid of the input feature.
If the point_location parameter is set to CENTROID, the location of each output point will be determined as follows:
If the point_location parameter is set to INSIDE, the location of the representative point of an input feature will be contained by the input feature and determined as follows:
| Boolean |
Code sample
The following Python window script demonstrates how to use the FeatureToPoint function in immediate mode.
import arcpy
arcpy.env.workspace = "C:/data"
arcpy.management.FeatureToPoint("parcels.shp", "c:/data/output/parcels_center.shp",
"CENTROID")
The following stand-alone script is a simple example of how to apply the FeatureToPoint function in a scripting environment.
# Name: FeatureToPoint_Example2.py
# Description: Use FeatureToPoint function to find a point inside each park
# import system modules
import arcpy
# Set environment settings
arcpy.env.workspace = "C:/data"
# Set local variables
inFeatures = "parks.shp"
outFeatureClass = "c:/output/output.gdb/parks_pt"
# Use FeatureToPoint function to find a point inside each park
arcpy.management.FeatureToPoint(inFeatures, outFeatureClass, "INSIDE")
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes