21
Using Python to Automate Map Series Creation at EEC Environmental 8/10/2015 1

Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

Using Python to Automate Map Series Creation

at EEC Environmental

8/10/2015 1

Page 2: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

EEC Environmental

• Environmental consulting• Wastewater, storm water• Regulatory compliance• Soil and groundwaterAssessmentRemediationLitigation support

• I.T. consulting

8/10/2015 2

Page 3: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

EEC Environmental

• Offices:Orange, CAOakland, CAAnnapolis, MDTampa, FL

• Booth: 1610

8/10/2015 3

Page 4: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

The Problem

8/10/2015 4

“Can we add a figure here?”

Page 5: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

Prior Art

• ArcGIS Data-Driven Pages

• AutoCAD Sheet Sets

• Templating (Django, Jinja)

• Software Build Systems

8/10/2015 5

Page 6: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

The Solution

8/10/2015 6

Page 7: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

Really. We just used them both.

8/10/2015 7

Page 8: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

THE PROCESS

8/10/2015 8

Page 9: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

8/10/2015 9

Create first map in ArcMap per usual

Page 10: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

8/10/2015 10

Replace map-specific parameters with {{ template_tags }}

Page 11: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

8/10/2015 11

Example Definition Query

("Status" Is Null OR "Status" <> 'Excavated') AND "Sampler" = 'EEC' AND "Type" <> 'Soil Boring (EEC) - New' AND "Analyte" = '{{Analyte}}' AND "Depth_Start" >= {{Start_Depth}} AND "Depth_Start" < {{End_Depth}} AND "Result" >= {{Action_Level}} AND "Units" ='{{Units_Lab}}' AND "OperableUnit_Name" = '1'

Page 12: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

8/10/2015 12

Example Title Block

Page 13: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

8/10/2015 13

Define everything different about each map in Excel (.csv)One row per figure

Page 14: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

8/10/2015 14

Run a simple geoprocessing tool

Page 15: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

8/10/2015 15

Wait…

(Usually < 1 minute per figure)

Page 16: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

8/10/2015 16

Figures are output in .mxd and .pdf!

Page 17: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

DEMO

Live demos are the best!

8/10/2015 17

Page 18: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

Future

• Additional places {{ tags }} can go

• Integration with data-driven pages

• Parallel processing?

• Integration with ArcGIS Server?

8/10/2015 18

Page 19: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

So What?

8/10/2015 19

• ArcPy is cool!

• Think beyond the ArcPy sandbox

• Start with Esri code samples

Page 20: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri

EEC Environmental

Booth 1610(714) 667-2300www.eecenvironmental.com

• Steve [email protected]

8/10/2015 20

Page 21: Using Python to Automate Map Series Creation · ArcPy sandbox • Start with Esri code samples. ... Author: Esri Subject: 2015 Esri User Conference Presentation Keywords: 2015 Esri