TUFLOW Viewer - Batch Exporting Maps

From Tuflow
Revision as of 19:04, 28 April 2021 by Ellis Symons (talk | contribs)
Jump to navigation Jump to search

Tool Description

TUFLOW Viewer offers the ability to batch export maps using mesh layers (does not support other result types yet e.g. time series, particles - it may be possible to use work arounds to get these types to work). This tool does not seek to replace other similar tools that may be inherently built in to QGIS, however does offer the ability to:

  • automatically add plots from the mesh layer to the maps
  • automatically load mesh results, plot, and export maps

It also offers convenience functionality for adding items such as a legend, images, scales etc, however these can also be added manually in the print layout.

The following steps through the process of batch exporting maps:

  1. Open the batch export map tool via Export >> Export Maps
    Maps BatchExport Menu.PNG
  2. On the layout tab, the user has the option to use a Default Layout or a Custom Layout. A cusom layout uses a Print Layout Template (.qpt) as an input. The recommended workflow is to:
    1. Use the Default Layout as a starting point
    2. Customise the layout using the print layout in QGIS
    3. Export the print layout as a template (.qpt)
    4. Use Custom Layout using the template file

    Maps LayoutTab DefaultCustom Options.PNG

  3. Assuming the above workflow, the Default Layout lets the user specify some items to add to the layout.
  4. Page Properties - defines the page size and the orientation of the exported maps. A page border is added by default, however can be turned off or edited in this section.
    Maps LayoutTab PageProperties.PNG
  5. Legend, Scale Bar, North Arrow - the next three items will add common map items. Users can edit the properties of the item and add things like a background and border.
    Animation Layout Item Settings.PNG
  6. Label - Users can also add a custom label with dynamic text. This is useful if the user would like to add information to the map such as the result name, result type, or date the map was produced. This can be done by using the buttons on the right-hand side of the label properties. User's can also add their own text to the label, however this will be static.
    • Dynamic Map Number - will add a map number to the label based on the order that the maps are exported
    • Dynamic Result Name - will add the result name to the label (e.g. M03_5m_001)
    • Dynamic Result Type - will add the result type to the label (e.g. Depth - Max)
    • Dynamic Date - will add the date the map was exported
    • Dynamic Workspace Location - will add the workspace path to the label
    Maps LayoutTab Label.PNG
  7. Plots - These are dynamic plot objects that will be added to the maps. To add a plot, the plot must already be available in one of the TUFLOW Viewer plotting windows
    Animation Layout Plot Item.PNG
    1. Use the add button Animation add button.PNG to add a plot
    2. Select the source of the plot lines that will be added (i.e. time series, cross section etc.)
    3. Select the plotting lines to add to the plot. Users can add more than one line or split the lines onto multiple plots. If the line is on secondary axis, this will be retained unless the need for the secondary axis becomes redundant (e.g. it's the only line on the plot)
    4. In addition to the plotted result types, users have the option of specifying Active Dataset and Active Dataset [Water Level For Depth]. This will use the plot location, but plot the active scalar result of the map. The latter option will use water level if the active scalar is depth. This option will not work for plotting from a vector layer if the user is using one of the fields for the plot legend entry (this will need to be turned off in the Settings >> Options >> Plotting
    5. Set the position. This is only the starting position and can be moved later in the print layout
    6. Set the plot properties. When the user clicks this button, TUFLOW Viewer will calculate the min/max for the plot axes. For lines on the cross-section and vertical profile plots, this can take some time as TUFLOW Viewer will need to step through every timestep to find the min/max values.
      Animation Plot Properties Dialog.PNG
      1. Plot Title - can be useful to indicate where the plot was extracted from by aligning the title with labels in the print layout
      2. Axis labels - will be populated with default values
      3. Axis Limits - will be populated with calculated extents and the extents can be recalculated using Auto Calc
      4. Legend - legend can be added or removed. Legend location options are not as extensive as the TUFLOW Viewer itself, most notably 'Auto' is not available.
      5. Grid lines - can be toggled on/off
      6. Figure Size - will default to 100 x 100. This can be changed in the print layout and the plot will be re-rendered prior to the animation to fit the desired size.
    7. If the plot point/line was drawn by the user (not a vector layer), a graphic object will be added to the appropriate location to indicate the extraction location. This can be toggled off by unchecking this box.
    8. Label for the graphic object - this can be changed later in the print layout
    9. Label position relative to the graphic object
    10. Label properties:
      Animation Label Properties Dialog.PNG
      1. Label font settings
      2. Background and box settings
  8. Images - Adds static images (e.g. company logo) to the maps. Adding images can also be added / edited later in the print layout
    Animation Image Item.PNG
    1. Use the add button Animation add button.PNG to add an image
    2. Browse or copy the file path location of the image to be added
    3. Position - this is the starting position and can be changed later in the print layout
    4. Image properties:
      Animation Image Properties Dialog.PNG
      1. Image size options - this can be changed later in the print layout
  9. Add maps in the Export Maps tab.
    • Result - result file (e.g. the .xmdf file). Results can be chosen from mesh layers that are already loaded into QGIS, or a file path can be specified and the tool will automatically load the mesh when required.
    • Scalar Type - scalar result type to be mapped. If the result isn't loaded yet, the user will need to type this result type in manually.
    • Vector Type - vector result type to be mapped. If the result isn't loaded yet, the user will need to type this result type in manually.
    • Time - timestep used for the map. If the result isn't loaded yet, the user will need to type this result type in manually.
    • Output - output location of map
  10. Users can import a list of maps from a csv file using the Import button. This allows users to use a program such as MS Excel to populate the map list.
    Maps Import Map List Dialog.PNG
    1. Delimited File - csv (or other text file) containing the map list
    2. Delimited Format - delimited format of the input file
    3. Header Rows - number of header rows to discard
    4. Columns - the columns that correspond to the appropriate columns in the tool. If the columnn names match the names in the tool, the import tool will automatically populate these values.
  11. Once all layout items have been chosen and added, clicking Preview will allow the user to view how it's going to look
    Maps Preview Button.PNG
  12. Clicking the preview button will open up the layout in the QGIS print layout. In this layout, the user can modify, move, resize, add, and remove items in the layout. The following items must retain their IDs:
    • The dynamic label must have the ID 'title'
    • Dynamic plots will have an ID 'plot_<n>' where <n> is the plot index (starting at index 0) based on the order they were added in the Default Layout
    • The graphic objects have an ID corresponding to their ID in the Default Layout
    Some of the useful information and tools in the print layout are:
    • All plot items are listed in the 'Items' box and their corresponding ID. Items can be selected in this box to show their properties and allow users to edit them (they can also be selected in the print layout).
    Animation Print Layout Items.PNG
    • Item properties can be edited using the Item Properties tab below the 'Items' box.
    Animation Print Layout ItemProperties.PNG
    • Use the tool Interactly Edit Map Extent Animation Interact With Map Icon.PNG to edit the zoom and position of the map in the print layout
    • When the map zoom and extents are adjusted the graphic objects will no longer be in the correct position, however that's ok because the next time either the preview is clicked or if the animation tool is run, they will be placed in their correct posistion
    • Use the tool Select / Move Item Animation Move Resize Item Icon.PNG to move and resize items in the print layout
    • Use Add Item menu to add other custom items such as a north arrow or scale bar
    Animation Add Item Menu.PNG
  13. Save the print layout as a template (.qpt) via the menu Layout >> Save as Template
    Animation Layout Menu.PNG
  14. Close the print layout
  15. Select the Custom Layout radio button in the layout tab in the export animation dialog and browse the saved template file (.qpt)
    Maps Custom Layout Button.PNG
    Note that all the default layout items will be overriden with the Custom Layout except for the plots and dynamic text. The plot position and size from the custom layout template will be used, however the plot content will still be taken from the Default Layout. Likewise for the dynamic text, the text will be taken from the Default Layout.
  16. The Preview button can be used multiple times to check that the layout is correctly being imported from the template
  17. Click Ok to run the tool and export the maps

Examples

The above steps serve as an example of how to batch export maps.

Links

Similar Tools

Back to TUFLOW Viewer Page