Summary from: http://help.arcgis.com/zh-cn/arcgisdesktop/10.0/help/index.html#/na/0017000000q5000000/
Package a map document and all referenced data sources to create a single, compressed . mpk file.
The illustration contains the folder structure of the unpacked map package for three feature layers. Usage
A warning will be issued when using this tool to encounter unsupported layer types (logical or tool layers). Layers that are not supported will not be written to the output.
The input layer must have a corresponding description for this tool to perform. To add a description, right-click the layer and click Properties, and then enter a description.
to unpack a map package , you can drag the .mpk file to arcmap or right-click the .mpk file and then click
- XP - c:\documents and Settings\ user name \my Documents\arcgis\packages
- Vista and Windows 7 - c:\users\ user name \documents\arcgis\packages
select when converting data to a file geodatabase
- Compressed raster format will be converted to a file geodatabase raster. The
- compressed vector format (such as the SDC format) is converted to a file Geodatabase feature class, and the original compressed data is lost.
uncheck the Span class= "Uicontrol" > when converting data to a file geodatabase
-
- commondata folder.
-
- ADRG, CADRG/ECRG, CIB, and RPF raster formats are always converted to file Geodatabase rasters. ArcGIS cannot write these formats directly. For efficiency, they will always be converted to file Geodatabase rasters.
-
For layers that contain joins or joins to a layer in a relationship class, all connected or related data sources are merged into the output folder.
For feature layers, the range parameter is used to select the features that will be merged. For raster layers, the range parameter is used to crop the raster dataset.
Some datasets refer to other datasets. For example, you might have a topology dataset that references four feature classes. Examples of other datasets that reference other datasets include geometric networks, networks, and locators. When a layer is merged or packaged based on these types of datasets, the participating datasets are also merged or packaged.
If only schema parameters are selected, only the schema of the input data source will be merged. A scenario is the structure or design of a feature class or table that consists of field and table definitions, coordinate system properties, symbology, definition queries, and so on. Data or records are not merged.
Data sources that do not support "schema only" are not merged or packaged. If only schema parameters are selected and the tool encounters a layer that does not support schema only, a warning message is displayed and the layer is skipped. If you specify a unique layer that does not support schema only, the tool will fail.
Merging or packaging a coverage or VPF layer copies the entire coverage or VPF dataset to the merged folder or packet.
Syntax Packagemap_management (in_map, output_file, {convert_data}, {Convert_arcsde_data}, {extent}, {Apply_extent_to_ ARCSDE})
Parameters |
Description |
Data type |
In_map |
The map document to be packaged. |
ArcMap Document |
Output_file |
The name and location (. MPK) of the output map package. |
File |
Convert_data (optional) |
Specifies whether the input layer is converted to a file geodatabase or retains its original format.
<esri_enumhead><esri_enumvaluehd><esri_enumdeschd>
- The convert- data is copied to the file geodatabase.
- preserve- will preserve the data format. This is the default setting.
|
Boolean |
convert_arcsde_data (optional) |
Specifies whether the input layer is converted to a file geodatabase or retains its original format.
<esri_enumhead><esri_enumvaluehd><esri_enumdeschd>
- convert_arcsde - &NBSP;ARCSDE data is copied to the file geodatabase. This is the default setting.
- preserve_arcsde - will retain the ARCSDE data and will reference it in the resulting merged folder or packet.
|
Boolean |
extent (optional) |
by using format x-min y-min X-Max Y-Max Specify the range by manually entering coordinates in the range parameter. In addition, if you want to use the scope of a particular layer, simply add the layer name to the scope parameter.
<esri_enumhead><esri_enumvaluehd><esri_enumdeschd>
- Maxof - The intersection of the input
- minof - input
- display - Same as display
- < layer > - with layer ... Same
|
Extent |
APPLY_EXTENT_TO_ARCSDE (optional) |
Specifies the scope that will be used to select the ArcSDE data source.
<esri_enumhead><esri_enumvaluehd><esri_enumdeschd>
- all- applies the specified range to all layers. This is the default setting.
- arcsde_only- applies the specified range to the ArcSDE layer only.
|
Boolean |
code examplePackagemap Example (Python window)
The following Python script demonstrates how to use the package Map tool in a Python window.
Import arcpyarcpy.env.workspace = "c:/arcgis/arctutor/editing" arcpy. Packagemap_management (' exercise1.mxd ', ' editingexercise1.mpk ', ' PRESERVE ', ' convert_arcsde ', ' # ', ' all ')
Packagemap Example (stand-alone script)
Find all the map documents that are located in the specified folder, and then create map packages for those map documents, respectively.
# name:packagemap.py# Description: Find All the map documents, reside in a specified folder and create map Packag ES for each map document.# author:esri# import System modulesimport osimport arcpyfrom arcpy import env# Set Environment Settingsenv.overwriteoutput = Trueenv.workspace = "c:/arcgis/arctutor/editing" # Loop through the workspace, find all the Mxds and create a map package using the same name as the Mxdfor mxd in arcpy. Listfiles ("*.mxd"): print "packaging" + mxd arcpy. Packagemap_management (Mxd, Os.path.splitext (MXD) [0] + '. MPK ', "PRESERVE", "Convert_arcsde", "#", "All")
Environment current workspace, scope related Topics Packaging toolset overview Creating map Package License Information ArcView: Yes Arceditor: Yes ArcInfo: Yes
ArcGIS MPK Package Map (data management)