From ca67fe493a50aa4d0b08ac6c12442630ee1e35c6 Mon Sep 17 00:00:00 2001 From: Dan Howe Date: Fri, 30 Aug 2019 10:03:59 +1000 Subject: [PATCH] Include date labels --- plot_heatmaps.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plot_heatmaps.py b/plot_heatmaps.py index 103e6de..d1c0422 100644 --- a/plot_heatmaps.py +++ b/plot_heatmaps.py @@ -88,6 +88,15 @@ def process(yaml_name): arcpy.mapping.UpdateLayer(df, update_layer, symbology_layer, 'TRUE') arcpy.RefreshTOC() + # Update date text fields + for e in arcpy.mapping.ListLayoutElements(mxd, 'TEXT_ELEMENT'): + if e.text == '': + t = params['PREVIOUS SURVEY DATE'] + e.text = '{}-{}-{}'.format(t[:4], t[4:6], t[6:8]) + elif e.text == '': + t = params['SURVEY DATE'] + e.text = '{}-{}-{}'.format(t[:4], t[4:6], t[6:8]) + # Prepare output directories datestr = re.search('\d+$', base_name).group() current_date = '{}-{}-{}'.format(datestr[:4], datestr[4:6], datestr[6:])