Iterate through data driven pages correctly

etta-drone
Dan Howe 6 years ago
parent e0bd513c66
commit 9f8165756f

@ -113,13 +113,13 @@ def process(yaml_name):
# Activate data driven pages # Activate data driven pages
ddp = mxd.dataDrivenPages ddp = mxd.dataDrivenPages
# Export to jpg for page_num in range(1, ddp.pageCount + 1):
for output_dir in output_dirs: ddp.currentPageID = page_num
page_name = ddp.pageRow.Beach
jpg_name = os.path.join(output_dir, page_name + '.jpg')
arcpy.mapping.ExportToJPEG( # Export beaches that are covered by current survey
mxd, jpg_name, resolution=200, jpeg_quality=80) if ddp.pageRow.Parent == beach.lower():
page_name = ddp.pageRow.Beach
jpg_name = os.path.join(output_jpg_dir, page_name + '.jpg')
def main(): def main():

Loading…
Cancel
Save