Copy Features (Data Management) |
|
Release 9.2
Last modified November 29, 2010 |
![]() ![]() ![]() Print all topics in : "Tools" |
Copies the selected features to a new feature class. If the input features are from a layer which has a selection, then only those features selected for the layer will be copied to the output feature class. If the input features are from a feature class or shapefile, then all features will be copied to the output feature class.
Usage tips
The Input Features (geometry and attributes) will be copied to the output feature class.
This tool can be used for data conversion as it can read many feature formats (any you can add to map) and write these out to shapefile or geodatabase (File, Personal or SDE).
If the output feature class already exists, it will be overwritten. To control the overwrite behavior in an application see the Tools/Options/Geoprocessing options, in a script see the OverwriteOutput property on the geoprocessor object. To add or append the features to an existing feature class (without overwritting it) use the Append tool instead.
The following environment settings affect this tool: Coordinate system, Extent, XY Tolerance, Z Tolerance, M Tolerance, XY Resolution, Z Resolution, M Resolution, Output XY domain, Output Z domain, Output M domain, Output has M values, Output has Z values, Default Z value, Configuration keyword, Output Spatial Grid.
Command line syntax
An overview of the Command Line window
CopyFeatures_management <in_features> <out_feature_class> {config_keyword} {spatial_grid_1} {spatial_grid_2} {spatial_grid_3}
Parameter | Explanation | Data Type |
<in_features> |
The features to be copied. |
Feature Layer | Raster Catalog Layer |
<out_feature_class> |
The feature class which will be created and to which the features will be copied. If the output feature class already exists and the overwrite option is set to true, the output will be deleted first. If the output feature class already exists and the overwrite option is set to false, the operation will fail. |
Feature Class |
{config_keyword} |
Geodatabase configuration keyword to be applied, if the output is an ArcSDE geodatabase or file geodatabase. For more information, see the CONFIG keyword environment setting. |
String |
{spatial_grid_1} |
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 |
{spatial_grid_2} |
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 |
{spatial_grid_3} |
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 |
copyfeatures_management d:\workspace\roads\arc d:\workspace\transport.shp
Scripting syntax
About getting started with writing geoprocessing scripts
CopyFeatures_management (in_features, out_feature_class, config_keyword, spatial_grid_1, spatial_grid_2, spatial_grid_3)
Parameter | Explanation | Data Type |
in_features (Required) |
The features to be copied. |
Feature Layer | Raster Catalog Layer |
out_feature_class (Required) |
The feature class which will be created and to which the features will be copied. If the output feature class already exists and the overwrite option is set to true, the output will be deleted first. If the output feature class already exists and the overwrite option is set to false, the operation will fail. |
Feature Class |
config_keyword (Optional) |
Geodatabase configuration keyword to be applied, if the output is an ArcSDE geodatabase or file geodatabase. For more information, see the CONFIG keyword environment setting. |
String |
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 |
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 |
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 |
# BatchCopyFeaturesToGDB.py # Description: # Loops through all the coverages in a workspace, finds all the arc # feature classes in those coverages, and copys those features to new # feature classes in a personal geodatabase. # Requirements: Python and the Python win32all extension # Author: ESRI # Data 11/11/2004 # Create Geoprocessing Object import arcgisscripting, sys, os gp = arcgisscripting.create() gp.Workspace = "c:\\wksp" out_gdb = gp.Workspace + "\\gdby.mdb" # If the output personal gdb does not exist, create it if not gp.Exists(out_gdb): gp.CreatePersonalGDB(os.path.dirname(out_gdb),os.path.basename(out_gdb)) # List the coverages covs = gp.ListDatasets("","coverage") cov = covs.Next() while cov: # List of the feature classes fcs = gp.ListFeatureClasses("","line",cov) fc = fcs.Next() while fc: try: out_name = gp.ValidateTableName("%s_%s" % (cov,fc), out_gdb) # Copy this cov's line feature class to a new geodatabase feature class gp.CopyFeatures(cov + os.sep + fc, out_gdb + os.sep + out_name) print "Successfull converting %s\\%s " % (cov, fc) except: print "Failed to convert %s\\%s\n%s" % (cov, fc, gp.GetMessages(2)) # Proceed to the next feature class fc = fcs.Next() # Proceed to the next coverage cov = covs.Next()