Skip to content

How to derive 24-hour intensities with QGIS

In Urban Strategy, intensities published by the traffic assignment model per daypart, usually the morning peak, evening peak and rest of day. This guide describes how to combine daypart intensities from an Urban Strategy scenario into one 24-hour (all-day) intensity value, using QGIS. The resulting layer can be used for reporting, visualization, or further analysis that requires all-day traffic volumes.

Time required: about 30 minutes
Prerequisites: the QGIS Connector plugin and an approved account with REST API access.

Learning objectives

  • How to identify the dimension_id of each daypart
  • How to load the roads collection per daypart from Urban Strategy into QGIS
  • How to combine daypart intensities into a 24-hour value using the field calculator
  • How to interpret and adjust the resulting expression for your own setup

What is a dimension_id?

A dimension in Urban Strategy is a unique combination of mode, trip purpose and daypart. Therefore, every road in the roads collection has a dimension_id, which points to the object_id in the traf_dimensions collection.

Step 1: Connect QGIS to Urban Strategy

Connect QGIS to Urban Strategy as described in the QGIS Connector tutorial.

Step 2: Load the traf_dimensions collection into QGIS

  1. In the QGIS browser panel, expand the relevant project and open the main bin.

    Main bin

  2. Double click the traf_dimensions collection to load it as a new layer into QGIS.

    traf_dimensions

  3. With the new layer selected, open the QGIS attribute table Attribute table. The layer contains, among others, the following columns:

    Column name Description
    DAYPART The daypart of the dimension
    DAYPART_ID The ID of the daypart
    DETAILS Describes the combination of daypart, mode and motive
    MODE_ID Points to the object_id in the traf_modes collection.
    MOTIVE The travel purpose of the dimension
    OBJECT_ID Unique identifier for the dimension
  4. Identify which object_id values match the dayparts to be summed into a 24-hour intensity layer. For this guide the following traf_dimension table is used.

    DAYPART DAYPART_ID MODE_ID MOTIVE OBJECT_ID
    Morning peak 1 1 Total 1
    Evening peak 2 1 Total 11
    Rest of day 3 1 Total 21

    Resulting in the object_id values 1, 11 and 21 as unique identifiers for the morning rush hour, evening rush hour and rest of day respectively.

    Be aware that this might be different in your case.

    The object_id values as used in this guide may be different from the ones you'll need. Make sure to always check the traf_dimensions collection of your setup.

Step 3: Load the morning rush hour intensities

  1. Open the scenario for which you want to configure the 24-hour intensities.

    Scenario bin

  2. Right click on the roads collection and choose configure.

    traf_dimensions

  3. In the filter field, enter a filter on dimension_id for the daypart you want to load. In this case, the morning rush hour, which corresponds to object_id 1 in the traf_dimensions collection (as identified in step 2). Therefore, load the roads layer with:

    dimension_id = 1
    

    To prevent loading the entire network, it's recommended to use additional filters such as:

    dimension_id = 1 AND district_id > 0
    

    Configuration filter

  4. After loading the layer, ensure to give it a different name. For example: roads_morning_rush_hour

Step 4: Load the evening rush hour intensities

Similarly to step 3, load the roads layer for the evening rush hour, which in this case corresponds to object_id 11 in the traf_dimensions collection (as identified in step 2). Therefore, the filter will be:

dimension_id = 11

Or with additional filters

dimension_id = 11 AND district_id > 0

Also rename this layer, for example to: roads_evening_rush_hour

Step 5: Load the rest of day intensities

Similarly to step 3 load the roads layer for the rest of day, which In this case corresponds to object_id 21 in the traf_dimensions collection (as identified in step 2). Therefore, the filter will be:

dimension_id = 21

Or with additional filters

dimension_id = 21 AND district_id > 0

Also rename this layer, for example to: roads_rest_of_day

Step 6: Create a 24-hour intensity

At this point you should have three road layers in QGIS: one for the morning rush hour, one for the evening rush hour and one for the rest of day.

  1. Duplicate one of the three daypart layers, for example roads_morning_rush_hour.

  2. Rename the copy, for example to roads_24_hours_intensity.

    Road layers 24-hour

Step 7: Calculate 24-hour intensity values

Every road layer has an INTENSITY_L and INTENSITY_R column, containing the intensity values on that side of the shape respectively. The intensity values in the roads collection have a certain duration, for example 2 hours or hourly intensities. This should be correct for when calculating the 24-hour intensity.

For this guide, the intensities have the following duration:

Daypart Intensity values Duration
Morning rush hour Vehicles / 2 hours From 7:00 to 9:00
Evening rush hour Vehicles / 2 hours From 17:00 to 19:00
Rest of day Vehicles / 2 hours From 9:00 to 17:00 and 19:00 to 7:00

Therefore the rest of day intensities should be scaled by 6.095 (12.19/2)

  1. Open the field calculator on the roads_24_hours_intensities layer.

  2. Update the existing INTENSITY_L field using the following expression:

    coalesce(
        attribute(
            get_feature('roads_morning_peak', 'OBJECT_ID', "OBJECT_ID"),
            'INTENSITY_L'
        ), 0
    )
    +
    coalesce(
        attribute(
            get_feature('roads_evening_peak', 'OBJECT_ID', "OBJECT_ID"),
            'INTENSITY_L'
        ), 0
    )
    +
    6.095 * coalesce(
        attribute(
            get_feature('roads_rest_of_day', 'OBJECT_ID', "OBJECT_ID"),
            'INTENSITY_L'
        ), 0
    )
  1. Repeat the same expression for the INTENSITY_R field:
    coalesce(
        attribute(
            get_feature('roads_morning_peak', 'OBJECT_ID', "OBJECT_ID"),
            'INTENSITY_R'
        ), 0
    )
    +
    coalesce(
        attribute(
            get_feature('roads_evening_peak', 'OBJECT_ID', "OBJECT_ID"),
            'INTENSITY_R'
        ), 0
    )
    +
    6.095 * coalesce(
        attribute(
            get_feature('roads_rest_of_day', 'OBJECT_ID', "OBJECT_ID"),
            'INTENSITY_R'
        ), 0
    )