Presentation is loading. Please wait.

Presentation is loading. Please wait.

Automated Plotting with the Emme Desktop API Peter Hidas Bureau of Transport Statistics Transport NSW.

Similar presentations


Presentation on theme: "Automated Plotting with the Emme Desktop API Peter Hidas Bureau of Transport Statistics Transport NSW."— Presentation transcript:

1 Automated Plotting with the Emme Desktop API Peter Hidas Bureau of Transport Statistics Transport NSW

2 Plotting in the Emme 3 Desktop  Emme Desktop provides excellent plotting functionality  A wide range of model outputs can be represented graphically  Frequent request for STM outputs  Examples:

3 STM plots: Road V/C-ratios

4 STM plots: Rail V/C-ratios

5 STM plots: Rail Stn Entries

6 STM plots: PT Time Savings

7 STM plots: PT mode share

8 STM plots: Access to Jobs

9 Plotting in STM projects STM projects: scenario modelling Up to 30-50 scenarios Steady increase in request for thematic plots Manual plotting –Slow, expensive, error-prone Solution –Automation

10 Emme Desktop API Allows automation of user interaction with the Emme Desktop GUI Using Python scripts Easy to learn –Basic knowledge of Python language –Desktop API Guide and Reference –Practical Example Develop own scripts

11 Plotting Script Aim –Automate frequent plotting tasks –Create a reusable script for a variety of tasks Solution –Separate the code from the input data –Create an easy coding system for the input data Outcome –make_plots.py

12 make_plots.py (version 1) Based on Desktop API Reference Functions –Connect to Emme Application –Activate a Database –Open a Worksheet –Apply a View –Set Base Scenario –Set Active Scenario –Set Path to save plot files –Export Screen View –Process input data

13 Coding the Input Data Based on Emme input coding principle Use the first character in a line to identify the type of input Codes used: –p or “ open ” –d –f –w –v –b –s … Lines starting with any other character are ignored

14 The Process Input Data Code Read input file line by line Split the line by space: list of words If line[0] == “ p ” : –call setApp function with rest of the line as project name OR “ open ” If line[0] == “ d ” : –call setDatabase function with rest of the line as database title Etc …

15 Example: Input Data Code

16 Make_plots (v1) Evaluation Worked well for simple cases Limitations –Only works with predefined fix worksheets without any change in parameters –Needs automated Legend Title updating done by Emme synchronization –Problems with bandwidth scaling fixed or automatically updated

17 Make_Plots.py (version 2) Additional functions coded –Force synchronisation of Legend Title not working …  –Set Legend Title –Set values in layer parameters Define new input codes –use first word instead of first character

18 Example: plot bus services Bus services by Bus Contract Region Special coding: –Select bus itins by region code –Set view boundaries move with selected bus itins

19 Input Code for Bus regions New input code: “r” for region call plotRegions function with list of regions as input

20 Version 3: set Title, scale, etc… Many plots using same worksheet Combine input data for one plot in same line separated by “ ; ” New input code: “ plot ” Input line structure: plot ; ; ;

21 Example: Input Code parts of the Legend Title

22 Summary - Current Status Work in progress Updated/improved for each new task Issues –bandwidth scale setting –synchronization –layer & parameter names –maximize worksheet window in Emme –switch off panels (left/right) –maximize Emme window –integrate with Emme data (e.g. PT services)


Download ppt "Automated Plotting with the Emme Desktop API Peter Hidas Bureau of Transport Statistics Transport NSW."

Similar presentations


Ads by Google