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?
arcpy.env.workspace = "C:/arcgis/ArcTutor/Editing"
arcpy.PackageMap_management('Exercise1.mxd', 'EditingExercise1.mpk', "PRESERVE", "CONVERT_ARCSDE", "DISPLAY", "ALL")
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