Extract Data (Production Mapping)
Resumen
Extracts input features to a geodatabase. You can optionally filter the input features with a polygon from another layer.
Uso
-
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 but be a polygon. If it is not, the tool will return a Filter feature layer must be polygon geometry type error.
To use this tool in a stand-alone script, check out a production mapping foundation license: arcpy.CheckOutExtension("Foundation").
Sintaxis
Parámetro | Explicación | Tipo de datos |
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 (Opcional) |
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 (Opcional) | The filter limits extraction to features that either intersect or are contained by features in the in_features feature layer.
| Boolean |
in_filtertype (Opcional) | Specifies the spatial relationship between in_datasets and in_features.
| String |
in_features (Opcional) |
Feature layer with one selected feature. | Feature Layer |
Ejemplo de código
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,"TRUE","INTERSECTS","Coast") # check the extension in arcpy.CheckInExtension("Foundation")
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',"NO_FILTER_BY_GEOMETRY","INTERSECTS","")