Feature To Point (Data Management)

Summary

Creates a feature class containing points generated from the centroids of the input features or placed within the input features.

Illustration

Feature To Point tool 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

LabelExplanationData 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.

  • Unchecked—The output point will be located at the centroid of the input feature. The output point may not always be contained by the input feature. This is the default.
  • Checked—The output point will be located within the input feature.

If the Inside parameter is not checked, the location of each output point will be determined as follows:

  • Multipoint features—The output point will be located at the average x- and y-coordinate of all the points in the multipoint.
  • Polyline features—The output point will be located at the weighted average x- and y-coordinate of the midpoints of all line segments in the line where the weight of a particular midpoint is the length of the correspondent line segment. Parametric (true) curves will be densified.
  • Polygon features—The output point will be located at the center of gravity (centroid) of the polygon.

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:

  • Multipoint features—The output point will be coincident with one of the points in the multipoint.
  • Polyline features—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.
  • Polygon features—The output point will be inside the polygon.

Boolean

arcpy.management.FeatureToPoint(in_features, out_feature_class, {point_location})
NameExplanationData 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.

  • CENTROIDThe output point will be located at the centroid of the input feature. The output point may not always be contained by the input feature. This is the default.
  • INSIDEThe output point will be located within the input feature.

If the point_location parameter is set to CENTROID, the location of each output point will be determined as follows:

  • Multipoint features—The output point will be located at the average x- and y-coordinate of all the points in the multipoint.
  • Polyline features—The output point will be located at the weighted average x- and y-coordinate of the midpoints of all line segments in the line where the weight of a particular midpoint is the length of the correspondent line segment. Parametric (true) curves will be densified.
  • Polygon features—The output point will be located at the center of gravity (centroid) of the polygon.

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:

  • Multipoint features—The output point will be coincident with one of the points in the multipoint.
  • Polyline features—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.
  • Polygon features—The output point will be inside the polygon.

Boolean

Code sample

FeatureToPoint example 1 (Python window)

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")
FeatureToPoint example 2 (stand-alone script)

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")

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics