1 / 22

Automated Plotting with the Emme Desktop API

Automated Plotting with the Emme Desktop API. Peter Hidas Bureau of Transport Statistics Transport NSW. Emme Desktop provides excellent plotting functionality A wide range of model outputs can be represented graphically Frequent request for STM outputs Examples:.

lark
Download Presentation

Automated Plotting with the Emme Desktop API

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Automated Plotting with the Emme Desktop API Peter HidasBureau of Transport Statistics Transport NSW

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

  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 <project filename> or “open” • d <database title> • f <folder path to save files> • w <worksheet name> • v <view name> • b <base scenario number> • s <scenario number> <scenario number> … • 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 <Title>;<dataFile>;<scale>;<FileName>

  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)

More Related