Select to view content in your preferred language

Automating Map Production with Arcpy using MapSeries/LoopCursor?

685
0
12-05-2019 07:18 AM
AnaVillaran
New Contributor

Hi all,

I am trying to automate PDF map production using arcpy for ArcGIS Pro. My idea is to create a custom tool that can be run from ArcGIS Pro with no manual input. 

This Map Book will be composed by first page showing Overview and rest of the pages showing Detailed Data and the visibility of the layers between Overview/Detailed Data pages.

So far I have tried the following:

  • Loop cursor to export Overview and Detailed Data pages, then use of 'arcpy.CreatePFDocument' and '<pdfDoc>.appendPages' to merge all the PDF pages.
  • Map Series creating a Feature Class composed by both Overview and Detailed Data extents. 

For both I have found the following impediments:

  • Loop cursor:
    • Unable to merge PDF pages while maintaining layers (layers shown on PDF viewer Layer's panel as shown on the attached image) - Also tried PyPDF2 Library to merge them without success. 
  • Map Series:
    • Unable to make Map Series to be dynamic and automated (enabling Map Series Class to be True and choosing the Index Layer and Field Properties to be the Page Number from the script). The only way I found to automate this is by letting the user refresh the Map Series bottom within the application while running the tool (This was still causing issues with layers representation within the Map Frame).
    • Even though I was able to minimize the export to PDF to be just an Overview 'PDF Lot' and a Detailed 'PDF Lot' so I only have to merge two PDFs, I still have the same issue as I had with Loop Cursor (no Layers shown on PDF viewer)
    • Is there anyway to export Map Series with different visibility settings and symbols for each of the Map Series pages? This would avoid needing to export different pages at different stages within the script and merging them at the end. 

Any thoughts about how to optimize it would be really appreciated.

Thanks,

Ana

0 Kudos
0 Replies