Feature To Point (Data Management)
Creates a feature class containing points generated from the representative locations of input features.
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.
If the Inside option on the dialog box is unchecked (the point_location parameter is set to CENTROID), the location of the output point will be determined as follows:
- For an input multipoint feature: the output point will be located at the average x and y coordinates of all the points in the multipoint feature.
- For an input line feature: the output point will be located at the weighted average x and y coordinates of the midpoints of all line segments in the line feature; where the weight of a particular midpoint is the length of the correspondent line segment. Parametric (true) curves are first densified.
- For an input polygon feature: the output point will be located at the center of gravity (centroid) of the polygon.
If the Inside option on the dialog box is checked (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:
- For an input multipoint: the output point will be coincident with one of the points in the multipoint.
- For an input line: the output point will be on the line. If the line is a parametric (true) curve, the output point will be at the midpoint of the line.
- For an input polygon: the output point will be inside the polygon.
The input features that can be multipoint, line, polygon, or annotation.
The output point feature class.
Specifies whether to use representative centers of input features or locations contained by input features as the output point locations.
The following Python window script demonstrates how to use the FeatureToPoint function in immediate mode.
import arcpy from arcpy import env env.workspace = "C:/data" arcpy.FeatureToPoint_management("parcels.shp", "c:/data/output/parcels_center.shp", "CENTROID")
The following standalone 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 # Author: ESRI # import system modules import arcpy from arcpy import env # Set environment settings 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.FeatureToPoint_management(inFeatures, outFeatureClass, "INSIDE")