From e0bd513c66c29e0c4b2bd381e8c8aec09b741fd6 Mon Sep 17 00:00:00 2001 From: Dan Howe Date: Fri, 3 Aug 2018 10:16:12 +1000 Subject: [PATCH] Fix data-driven pages output bug --- plot_heatmaps.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/plot_heatmaps.py b/plot_heatmaps.py index 6eb7859..d868c14 100644 --- a/plot_heatmaps.py +++ b/plot_heatmaps.py @@ -110,6 +110,9 @@ def process(yaml_name): if is_latest: output_dirs.append(output_dir_latest) + # Activate data driven pages + ddp = mxd.dataDrivenPages + # Export to jpg for output_dir in output_dirs: page_name = ddp.pageRow.Beach @@ -118,21 +121,6 @@ def process(yaml_name): arcpy.mapping.ExportToJPEG( mxd, jpg_name, resolution=200, jpeg_quality=80) - # Activate data driven pages - ddp = mxd.dataDrivenPages - - for page_num in range(1, ddp.pageCount + 1): - ddp.currentPageID = page_num - - # Export beaches that are covered by current survey - if ddp.pageRow.Parent == beach.lower(): - page_name = ddp.pageRow.Beach - jpg_name = os.path.join(output_jpg_dir, page_name + '.jpg') - - # Export to jpg - arcpy.mapping.ExportToJPEG( - mxd, jpg_name, resolution=200, jpeg_quality=80) - def main(): example_text = """examples: