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

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
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 1 (Python window)

This sample ArcGIS Python window script uses the ExtractData tool to extract features from an Oracle geodatabase into a file geodatabase.

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 Python script)

This stand-alone Python script 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
# Author: ESRI
# Date: March 2010

import arcpy

# check out a foundation license
arcpy.CheckOutExtension("Foundation")

# import the production mapping toolbox - you may have to change this path
arcpy.ImportToolbox(r'C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Production Mapping Tools.tbx')

# 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

This tool does not use any geoprocessing environments

Related Topics

Licensing Information

ArcView: No
ArcEditor: Requires Production Mapping
ArcInfo: Requires Production Mapping

5/4/2011