Map Package Extent

11-21-2022 08:16 AM
Labels (1)
New Contributor

Hi all,

I have many maps with multiple data types, trying to generate map packages for delivery, and I need to clip the data to the map's extent. Arcpy seems to be able to achieve this functionality. However  I have tried setting the extent to DISPLAY/MINOF/MAXOF, but the results are not what I expect. 

Could you please show me how to change the statement,  and set the range of the package to the XY range of the map or use a layer to clip?

import arcpy
arcpy.env.workspace = "C:/arcgis/ArcTutor/Editing"
arcpy.PackageMap_management('Exercise1.mxd', 'EditingExercise1.mpk', "PRESERVE", "CONVERT_ARCSDE", "DISPLAY", "ALL")

Package Map 

Specify the extent by manually entering the coordinates in the extent parameter using the format X-Min Y-Min X-Max Y-Max. To use the extent of a specific layer, specify the layer name.

MAXOF—Union of inputs
MINOF—Intersection of inputs
DISPLAY—Same extent as current display
<Layer> —Same extent as specified layer

In addition, I also found that the custom extent needs to be set when the clip layer is in a map. I wonder if there is any connection between the two.
Clip layers in a map 


Please help.


0 Kudos
0 Replies