Convert a map series to individual layouts

2311
10
08-25-2022 08:19 AM
Status: Closed
Labels (1)
GregWyatt
New Contributor II

The map series is useful if all layout details are essentially the same. If you need to annotate pages differently in a substantial fashion, a map series is overly restrictive. 

If it were possible to export/convert a map series into individual maps and layouts, it would allow the user to do the majority of the work in the series, then edit the individual layouts separately.

I'm asking for the ability to convert a map series to individual maps and layouts.

10 Comments
JeffBarrette

Hello Greg,

Have you considered Python Map Automation? 

https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/introduction-to-arcpy-mp.htm

I don't know the details of your project but I personally think creating a layout for each map series page can be a bit too much for the project and difficult to make the same updates to all layouts, if ever needed.

I'm not clear on how your need "annotate" from page to page but there could be a solution with a single layout.  If you are using annotation, those layers could be duplicated, one for each layout, or use a definition query to control the visible anno features.  By using python code along with your map series you can customize what happens from page to page.  Arcpy.mp can easily control the visibility of layers or set properties like definition query, etc.  If you are familiar with Python, we have a couple of samples you might want to evaluate: 

Go to: https://esriurl.com/arcpy.mp/samples (for all our samples)

Then check out: Thematic Map Series and MultipleElementLayoutManager samples

The later is a bit more advances in that all information is persisted in a table that controls exactly what gets displayed on a layout.

Jeff - Layout and arcpy.mp teams.

 

KoryKramer
GregWyatt
Hi Jeff
I did a quick glance at the links you gave me, and I'm not seeing how they could be a lot of help in my case.
We have 50+ Tree Farms (management areas) that I do a map set on. While most of those can be done successfully with a map series, there are a few that are too spread out to be done at a useful scale on a Tabloid size piece of paper. Some I need to do multiple frames with an overview frame to show the relationship of the pieces. One I need to split into multiple tabloid maps. Most fit just fine in a landscape page. Some are too tall for landscape but will fit in a portrait Tabloid page. Even on those that fit on a landscape tabloid page I sometimes want to make adjustments to the map centering to better show access routes to the property. I am aware that I could do the last with a Bookmark series, but that would mean making and maintaining 50+ bookmarks to accommodate 1 or 2 maps.

I also do a subset of our Tree Farms in maps for public access. These are given out to the public when we issue them a permit to access our land. On these maps, it is often necessary to 'mark up' maps to show which gates the public is allowed to access and which gates they are not, etc. I usually do this with Callouts with leaders pointing to the appropriate locations. If I do this on a series base map, then they show up on a neighboring Tree Farm map causing confusion. Applying edits to a layout in a series is problematic because you lose the edits if you need to regenerate the series.
My thought was to start with a series to get the majority of the layout and surrounds done once, then convert the map series into individual maps and layouts. I could then edit those outliers in whatever form is necessary without affecting other maps in the series.
I have just done essentially that with my public access maps. I started with a Map and Layout that worked for a majority of the areas. I then cloned the map and layout, edited the definition query, edited the title text, repositioned the map, made any layout changes needed, and finally adding Callouts where appropriate. Lather, Rinse, Repeat 35 times.
I can't help thinking I'm not the only one facing these challenges.
I can send you some sample maps if it would help.
Greg

[cid:image001.png@01D8B868.BCBE5750]
Greg Wyatt
IT Manager
www.starkerforests.com<>
541-929-2477 (phone)


GregWyatt

Kory is correct. This is the same problem. I hadn't found that Idea when I posted. I was suggesting a means to this end of the same problem. 

Although if I had a 256 page map and layout project like SarahParks, I would REALLY want to have the ArcGIS Pro equivalent of the MXD Doctor to save the project if it got corrupted. (Yes, I know, a separate Idea posting)🙂

JeffBarrette

Greg,

Thanks for the clarification.  I personally wouldn't give up on python automation, but that's me, a Python automation guy.  The second sample was based on a customer project I built for a customer with the exact issue you had.  They had 400 individual MXDs and they had such a hard time managing those MXDs.  I built a database solution where the misfit layouts configurations were persisted in a table.  If the table record existed for that index feature, then the Python script would do its reconfiguration for that page, etc (all run from a single MXD).

Anyway, having a tool to create a layout / map for each page in a map series does NOT exist yet BUT at 3.1 implemented a way to createMap() and copyItem.  This would allow you to copyItem(Layout) for each map series index feature and createMap for each mapframe, when needed.

This seams like a fun project to solve,

Jeff - Layout and arcpy.mp teams

DiogoFnds

@JeffBarrette I'm very interested in the update that should come with 3.1. As I proposed in an other similar Post idea, it would be just a matter of having the option to separately personalize each page of the map series. You can start with a basic common layout, but with the option to independently modify the pages as needed. I currently have an other issue related to this. I am trying to create a map series by bookmark, but in some pages I need a different scale of representation. The map series does not allow me to change the scale, nor the extent of the map frame if I need it.

I understand that with python automation almost everything can be done. But at this point we should start building our own alternative to ArcGIS, python script by python script, instead of relying on ArcGIS pro anymore 😉 - (And that's called Qgis)

I would be grateful to the ArcGIS team if they would consider implementing this function.

 

JeffBarrette
Status changed to: Closed

I'm going to close this issue.  I think there is a very simple solution using arcpy.mp.  I've made slight changes to the second code snippet from the MapSeries Class help topic:

https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/mapseries-class.htm

So it iterates through each map series page and instead of exporting to PNG, it copies a layout and names it based on the map series name.

import arcpy, os

p = arcpy.mp.ArcGISProject(r"C:\temp\GreatLakes\GreatLakes.aprx")
l = p.listLayouts('*_MS*')[0]
if not l.mapSeries is None:
  ms = l.mapSeries
  if ms.enabled:
    for pageNum in range(1, ms.pageCount + 1):
      ms.currentPageNumber = pageNum
      pageName = ms.pageRow.NAME
      print(f"Copying {pageName} to new layout")
      p.copyItem(l, pageName)
p.saveACopy(r"C:\temp\GreatLakes\GreatLakes_MSPages2Layouts.aprx")
os.startfile(r"C:\temp\GreatLakes\GreatLakes_MSPages2Layouts.aprx")

 

KevinDonahue3

This script seemed extremely promising, but after adapting it and trying it out, it only seems to produce copies of the map series, not the individual layouts.  Am I missing something, because I could have accomplished the same thing by right clicking and selecting copy several times.

Is it actually possible to export out pages from a map series as individual editable layouts or layout files or is this another wild goose chase?

JeffBarrette

@KevinDonahue3 the above script does duplicate/copy the layout (including the  map series setup), the difference is that each newly saved layout has the correct extent for each page based on the map series index feature.  If your preference is to NOT have a map series at part of the layout, then you can disable it.  I slightly modified the code above to do that.  Now when you open each newly copied layout, the map series is disable.

import arcpy, os

p = arcpy.mp.ArcGISProject(r"C:\temp\GreatLakes\GreatLakes.aprx")
l = p.listLayouts('*_MS*')[0]
if not l.mapSeries is None:
  ms = l.mapSeries
  if ms.enabled:
    for pageNum in range(1, ms.pageCount + 1):
      ms.currentPageNumber = pageNum
      pageName = ms.pageRow.NAME
      print(f"Copying {pageName} to new layout")
      cpLyt = p.copyItem(l, pageName)
      cpLyt.mapSeries.enabled = False
      
p.saveACopy(r"C:\temp\GreatLakes\GreatLakes_MSPages2Layouts.aprx")
os.startfile(r"C:\temp\GreatLakes\GreatLakes_MSPages2Layouts.aprx")

 

Does this do what you need?

Jeff - arcpy.mp and Layout teams

KevinDonahue3

Thanks Jeff, I appreciate the update and the clarification.  Apologies if my previous response was a little terse, but I misunderstood the intent of the script a little and was irritated that it didn't do what I was looking for (it was a long day).

I was hoping for a way to convert each page of the map series into a separate layout with an independent map or perhaps a way to export each page as a layout file (which should accomplish the same thing). In the end I was able to accomplish what I needed, but it required a lot of copies of the map series and a little juggling.

One question I had while working on it, that you may be able to help with is if it's possible to control the map series variable manually somehow.  As far as I'm aware that variable is only controlled by the key feature class in the map series itself, is that accurate?  It could be very handy to have variables within the map that I could change to update multiple definition queries at once, but as far as I know, this is only doable through a map series and is quite restrictive.

Thanks again for the help!

Kevin