Extract Data (Production Mapping)
Summary
Extracts input features to a geodatabase. You can optionally filter the input features with a polygon from another layer.
Usage
-
Input Datasets can include points, polylines, polygons, and annotation features.
If the input features include a topology, features are extracted from all the layers that participate in the topology. This may be in addition to the layers you have specified in the Input Datasets parameter.
Extracted data will have the same name as Input Datasets.
All data in Input Datasets must originate from the same workspace.
If extracted data originate from a feature dataset, the tool will create a feature dataset of the same name in the target geodatabase.
The target geodatabase must exist before this tool can run.
The Re-use Schema (in_reuse_schema) parameter is enabled for file and personal geodatabases only.
The Filter by Geometry parameter requires one selected feature in the Filter Feature Layer. The tool will return a Filter feature layer selection count not equal to 1 error if there are zero or more than one selected features.
The selected feature in the Filter Feature Layer must be a polygon. If it is not, the tool will return a Filter feature layer must be polygon geometry type error.
Syntax
Parameter | Explanation | Data Type |
in_datasets [in_datasets,...] |
The input data to extract into another geodatabase. | Feature Layer; Table View; Dataset |
in_target_gdb |
The workspace into which data will be extracted. | Workspace |
in_reuse_schema (Optional) |
Indicates whether to reuse a geodatabase that contains the schema of the data you want to replicate. This reduces the amount of time required to replicate the data. This option is only available for checkout replicas.
| String |
in_usefilter (Optional) | The filter limits extraction to features that either intersect or are contained by features in the in_features feature layer.
| Boolean |
in_filtertype (Optional) | Specifies the spatial relationship between in_datasets and in_features.
| String |
in_features (Optional) |
Feature layer with one selected feature. | Feature Layer |
Code Sample
The following Python window script demonstrates how to use the ExtractData tool.
sourceDb=r'c:\data\Socal_sample_oracle.sde\SOCAL_DATA.SC_Index'
arcpy.ExtractData_production(sourceDb,r'c:\data\outExtents.gdb',"DO_NOT_REUSE","NO_FILTER_BY_GEOMETRY","INTERSECTS","")
The following stand-alone script demonstrates how to use the ExtractData tool. It extracts production mapping sample data from an ArcSDE geodatabase. The script extracts data based on a single selected feature describing an AOI.
# Name: ExtractData.py
# Description: Extracts data from the Production Mapping SoCal sample data
import arcpy
# check out a foundation license
arcpy.CheckOutExtension("Foundation")
# set our workspace to an sde connection file
arcpy.env.workspace = "c:/data/SoCal.sde"
# fully qualified name to an ArcSDE feature class (dataset/feature class)
coastpath = "socal.GIS.SoCal/socal.GIS.CoastA"
# make a feature layer from islands in the CoastA feature class in the
# prod mapping sample data
if arcpy.Exists("Coast") == False:
arcpy.MakeFeatureLayer_management(coastpath,"Coast")
# select an island - verify that objectid 84 is an island in your data
arcpy.SelectLayerByAttribute_management("Coast","NEW_SELECTION","objectid=84")
checkoutDb = "c:/data/SoCalIslandTrees.gdb"
# make a new geodatabase
if arcpy.Exists(checkoutDb) == False:
arcpy.CreateFileGDB_management("c:/data","SoCalIslandTrees.gdb")
# another fully qualified ArcSDE name (dataset/feature class)
treespath="socal.GIS.SoCal/socal.GIS.TreesA"
# check out some data into the new file gdb
arcpy.ExtractData_production(treespath,checkoutDb,"DO_NOT_REUSE","FILTER_BY_GEOMETRY","INTERSECTS","Coast")
# check the extension in
arcpy.CheckInExtension("Foundation")