Extract Data (Production Mapping)

License Level:BasicStandardAdvanced

Summary

Extracts input features to a geodatabase. You can optionally filter the input features with a polygon from another layer.

Usage

Syntax

ExtractData_production (in_datasets, in_target_gdb, {in_reuse_schema}, {in_usefilter}, {in_filtertype}, {in_features})
ParameterExplanationData 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.

  • DO_NOT_REUSEDo not reuse schema. This is the default.
  • REUSEReuse schema.
String
in_usefilter
(Optional)

The filter limits extraction to features that either intersect or are contained by features in the in_features feature layer.

  • FILTER_BY_GEOMETRYApply the filter set in in_filtertype.
  • NO_FILTER_BY_GEOMETRYDo not apply the spatial filter.
Boolean
in_filtertype
(Optional)

Specifies the spatial relationship between in_datasets and in_features.

  • INTERSECTSExtract features from in_datasets that intersect features in the in_features parameter.
  • CONTAINSExtract features from in_datasets that are contained by the selected feature in the in_features parameter.
String
in_features
(Optional)

Feature layer with one selected feature.

Feature Layer

Code Sample

ExtractData example (Python window)

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

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

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: No
ArcGIS for Desktop Standard: Requires Production Mapping
ArcGIS for Desktop Advanced: Requires Production Mapping
12/18/2014