Feature To Point (Data Management)

Available with Advanced license.

Summary

Creates a feature class containing points generated from the representative locations of input features.

Illustration

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

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

Syntax

arcpy.management.FeatureToPoint(in_features, out_feature_class, {point_location})
ParameterExplanationData Type
in_features

The input features that can be multipoint, line, polygon, or annotation.

Feature Layer
out_feature_class

The output point feature class.

Feature Class
point_location
(Optional)

Specifies whether to use representative centers of input features or locations contained by input features as the output point locations.

  • CENTROIDUses the representative center of an input feature as its output point location. This point location may not always be contained by the input feature. This is the default.
  • INSIDEUses a location contained by an input feature as its output point location.
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.FeatureToPoint_management("parcels.shp", "c:/data/output/parcels_center.shp", 
                                "CENTROID")
FeatureToPoint example 2 (stand-alone script)

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

# 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.FeatureToPoint_management(inFeatures, outFeatureClass, "INSIDE")

Licensing information

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

Related topics