batch creating MMPK with clipped extent

558
3
04-30-2021 01:00 PM
FrancisMoisan1
New Contributor II

Hi, I have a aprx project with a map in it.

The map have many layers and a specific layer (the boundarys) with 10 polygons.  I need to iterate through each record  of the boundary and create a MMPK for every polygon within the layer.

I do use search cursor to find my information (name, etc...).  Then I will specify a definition query on my layer (boundary). Then I export a MMPK with the CLIP option.

The first MMPK is clipped well, but all other are full with the full extent of the map, even if the layer has a definition query.

If I do thiw manually (10 times), it works.

But If i do this with Python...  Only the first one (mmpk) is well clipped.

ANy idea why I can't batch create those other MMPK ? why the create mobil map package don't use the extent except for the first one ?

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

did you specify the extent explicitly?

If an extent is not specified, the visible extent of the map will be used to define the area of interest (AOI) and consolidate only those features that intersect that extent.

Create Mobile Map Package (Data Management)—ArcGIS Pro | Documentation

arcpy.management.CreateMobileMapPackage(in_map, output_file, {in_locator}, {area_of_interest}, {extent}, {clip_features}, {title}, {summary}, {description}, {tags}, {credits}, {use_limitations}, {anonymous_use}, {enable_map_expiration}, {map_expiration_type}, {expiration_date}, {expiration_message}, {select_related_rows}, {reference_online_content})


... sort of retired...
0 Kudos
FrancisMoisan1
New Contributor II

Hi!  I do use an {area_of_interest} and in the doc : "Polygon layer that defines the area of interest. Only those features that intersect the area_of_interest will be included in the mobile map package."

So the extent is optional (in my comprehension).  The problem is that for the first area of interest, it works, but for the others... it take all the map, not the area of interest...

and I have get this message : ERROR 000204

https://pro.arcgis.com/en/pro-app/latest/tool-reference/tool-errors-and-warnings/001001-010000/tool-... 

0 Kudos
DanPatterson
MVP Esteemed Contributor

The error has nothing to do with the extent but either the input or output data.

as for area_of_interest vs extent, perhaps making a standalone featureclass rather than a definition query might help


... sort of retired...
0 Kudos