Create Feature Class (Data Management)

Creates an empty feature class in a geodatabase, or shapefile in a folder.


Usage Tips

Syntax

CreateFeatureClass_management (out_path, out_name, geometry_type, template, has_m, has_z, spatial_reference, config_keyword, spatial_grid_1, spatial_grid_2, spatial_grid_3)
Parameter Explanation Datatype
Output Location (Required)

The ArcSDE, personal or file geodatabase, or folder in which the output feature class will be created. This workspace must already exist.

Workspace | Feature Dataset
Output Feature Class (Required)

The name of the feature class to be created.

String
Geometry Type (Optional)

The geometry type for the input feature class.

  • POINT
  • MULTIPOINT
  • POLYGON
  • POLYLINE

String
Template Feature Class (Optional)

The feature class used as a template to define the attribute schema of the output feature class.

Feature Layer
Has M (Optional)

Determines if the feature class contains linear measurement values (m-values).

  • DISABLED—The output feature class will not have m-values.
  • ENABLED—The output feature class will have m-values.
  • SAME_AS_TEMPLATE—The output feature class will have m-values if the template has m-values. If the template does not have m-values, the output feature class will not have m-values

String
Has Z (Optional)

Determines if the feature class contains elevation values (z-values).

  • DISABLED—The output feature class will not have z-values.
  • ENABLED—The output feature class will have z-values.
  • SAME_AS_TEMPLATE—The output feature class will have z-values if the Template has z-values. If the Template does not have z-values, the output feature class will not have z-values.

String
Spatial Reference (Optional)

The spatial reference of the output feature class. The dialog allows you to pick a coordinate system. If you wish to control other aspects of the spatial reference (ie the xy, z, m domains, resolutions, tolerances) use the relevant environments (click the environments button). If you choose the "Import..." option on the dialog and select an existing dataset, all spatial reference properties from that dataset (coordinate system, domains and tolerances) will be used.

Spatial Reference
Configuration Keyword (Optional)

The configuration keyword that determines the storage parameters of the table in a Relational Database Management System (RDBMS)—ArcSDE only.

String
Output Spatial Grid 1 (Optional)

The size of the output feature classe's spatial grid index. The following formats support spatial index grids: personal geodatabase, file geodatabase or ArcSDE geodatabase. If this value is left blank (or 0) a valid grid size will be calculated automatically.

Double
Output Spatial Grid 2 (Optional)

The size of the output feature classe's second spatial grid index. This value must be at least 3 times larger than the first index grid. The following formats support more than one spatial index grids: file geodatabase or ArcSDE geodatabase. For more information, see the Add Spatial Index tool. Note that personal geodatabase support only one spatial index grid.

Double
Output Spatial Grid 3 (Optional)

The size of the output feature classe's third spatial grid index. This value must be at least 3 times larger than the second index grid. The following formats support more than one spatial index grids: file geodatabase or ArcSDE geodatabase. Note that personal geodatabase support only one spatial index grid.

Double
Data types for geoprocessing tool parameters

Script Example

# Purpose: Append several feature classes together

# Create the Geoprocessor object
import arcgisscripting
gp = arcgisscripting.create()

try:
    # Set the workspace (to avoid having to type in the full path to the data every time) and the toolbox
    gp.Workspace =  "d:/project93/data"
    gp.toolbox = "management"

    # Set a variable to store the updated feature class
    out_feat_class = "mass_towns.shp"

    # Process:  Create a feature class to update
    gp.CreateFeatureclass(gp.workspace, out_feat_class, "POLYGON", "amherst.shp")

    # Process: Append the feature classes into the feature class
    gp.Append("amherst.shp;hadley.shp;pelham.shp;coldspring.shp", out_feat_class, "NOTEST")

except:
    # If an error occurred while running a tool print the messages
    print gp.GetMessages()

See Also

  • Create Feature Dataset (Data Management)
  • Create Personal GDB (Data Management)