Time zone attribute

The time of day (and possibly the date) changes for a vehicle when it crosses a time zone. If a time zone attribute is not configured on a network dataset that spans multiple time zones, time-of-day values in an analysis can be a source of confusion and inaccuracy. You can add a time zone attribute to your network dataset to model time zones.

This topic explains why configuring time zones on your network dataset may be necessary and describes how to configure a time zone attribute.

When a time zone attribute is necessary

Not every network dataset requires a time zone attribute, but it is necessary under certain circumstances:

  • The network is configured to model live traffic.
  • The network's edges span multiple time zones, and the network is configured to model historical traffic.
  • The network's edges span multiple time zones, and it will be used for analysis with a time-based impedance and a start time or time windows that aren't specified in Coordinated Universal Time (UTC).
  • The network will be used for Last Mile Delivery analysis.

Time zones and network analysis

Time zones come into play in network analysis in several ways.

Interpretation of time-related analysis settings

Network analysis can optionally include several time-related settings. For instance, time windows can be used to model appointment times or the hours during which a facility is open. A start time can be used to model the time of day when a traveler begins a journey. Analysis output fields show arrival and departure times.

Configuring a time zone attribute allows you to enter and interpret these time-of-day properties, particularly for a network dataset that spans multiple time zones. Otherwise, the correct interpretation of the time settings may be ambiguous, the values may be wrong, or the analyst may need to convert all values to UTC.

For example, assume you add two stops—one in the eastern time zone and another in the central time zone—and want to set both their time windows to 8:00 a.m. to 9:00 a.m. local time. If time zones aren't configured, you would have to convert both time windows to UTC and adjust the analysis settings to indicate that times should be interpreted as UTC.

When time zones are configured on the network dataset, the times you enter are automatically interpreted using the local time of the underlying edge, and Network Analyst manages the time conversions internally.

Accuracy of travel time calculations

For a network dataset configured with traffic, the travel time to traverse an edge in the network depends on the traffic conditions at the time of day that edge is traversed. If the time of day is incorrect because time zones are not properly configured, the wrong travel time may be calculated, and the analysis results may be inaccurate.

For example, assume that at 8:38 a.m. a route analysis traverses two adjacent edges, starting from one edge in the mountain time zone and continuing along another in the Pacific time zone. If a time zone attribute is not configured, the network dataset will ignore the time differential and retrieve the edges' travel times based on only one time zone. This means that instead of retrieving the travel time for the edge in the Pacific time zone for 7:38 a.m., it could retrieve the travel time for 8:38 a.m. or possibly some other time of the day, depending on the default time zone.

If time zones are configured properly, however, the travel time of the edge in the mountain time zone is evaluated for 8:38 a.m. local time and the edge in the Pacific time zone is correctly evaluated for 7:38 a.m. local time. The accuracy of travel times in a traffic-enabled network dataset is thus maintained.

Driving directions

When a network has a time zone attribute, driving directions alert drivers of time zone changes along their routes.

Directions window with change in time zone
The directions show that a vehicle crosses a time zone boundary at 8:38 a.m., which is 7:38 a.m. in the new time zone. The directions alert the driver of the one-hour time change.

How network datasets model time zones

Time zones are modeled in a network dataset using a time zone attribute, which assigns a time zone to each network edge using evaluators, which are configured in a similar way to cost and restriction attributes. For a network contained entirely within one time zone, a constant evaluator is sufficient to set the time zone for all edges. If the network spans multiple time zones, a field script evaluator can be used to reference a field in each edge source that identifies the edge's time zone.

The list of time zones available for use by the network is defined in a time zone table in the geodatabase that contains the network. A time zone table must have a text field named MSTimeZone, and each row in this table must include a string value that matches one of the official time zone IDs recognized by the Windows operating system.

Time zones have a temporal offset with respect to UTC. Local rules specify what the UTC offset should be, whether daylight saving time is observed, and, if it is, the offset and date ranges for daylight saving. These rules can change frequently; keeping track of all current and past rules is a difficult task. Fortunately, the Windows operating systems keep these rules current by delivering any time zone changes in the world to your computer through Windows updates. The time zones and their rules are stored in the Windows registry. The ArcGIS Network Analyst extension retrieves the UTC offsets and daylight saving time rules for time zones from the Windows registry.

The time zone attribute is configured in the Network Dataset Properties dialog box on the Time Zone tab of the Travel Attributes page:

Time Zone tab

The following properties can be configured:

  • Add Time Zone Attribute—Check this check box to enable or disable time zone support for the network dataset.
  • Time Zone Table—The drop-down list contains time zone tables that reside in the network dataset's workspace.
  • Evaluators—Each attribute defined in the network must provide values for each source and direction (along and against for edges) participating in the network. An evaluator assigns values for the attribute of each source and travel direction, and a default evaluator for each element is used for those sources and directions that do not have an assigned evaluator for an attribute.

    Learn more about evaluators

Configure the time zone attribute

To perform an analysis using time zones, the time zone attribute must be configured on a network dataset. The required configuration is different depending on whether the data in the network is contained within a single time zone or spans multiple time zones.

Note:

When you change any network attributes, you must build the network dataset to reestablish the connectivity, recalculate affected attributes, and update the network elements.

Learn more about when a rebuild is required

Configure the time zone attribute for a network that spans multiple time zones

When the network includes streets in different time zones, a field in each edge source can be used to indicate the time zone of each feature. The time zone attribute should be configured with a field script evaluator that references this field.

The conceptual diagram below shows a general overview of how this configuration works. A field called TimeZoneID on the edge source feature class indicates the time zone the features are in. The TimeZoneID field value is a foreign key to a time zone table, which resides in the same workspace as the network dataset and stores a list of time zones relevant to the network. The MSTimeZone field in the time zone table is also a foreign key but to an entry in the Windows registry. (It's more common to see integer values as identifiers and foreign keys; however, the registry uses text to identify time zones.) The registry provides information to Network Analyst about the UTC offset and any date ranges for daylight saving time.

Conceptual overview of time zones in the network dataset
Streets with a TimeZoneID field value of 14 are highlighted and related to the Pacific Standard Time record in the time zone table. The MSTimeZone value then relates the streets to the Pacific Standard Time key in the registry. These relationships allow Network Analyst to determine that these streets have a UTC offset of -8 hours from November to March and an offset of -7 from March to November.

  1. Create a time zone table in the network dataset's workspace.

    The table can have any name, but it must have a text field named MSTimeZone.

    Create a table by right-clicking the geodatabase and choosing New > Table or using the Create Table geoprocessing tool.

  2. Add a row to the table for each time zone needed by the network and set the MSTimeZone field values for each row to a time zone ID recognized by the Windows registry.

    To generate a list of time zone IDs recognized by the Windows registry, enter tzutil /l in a Windows command prompt. The ID is the second value returned for each time zone.

    Screenshot of output from Windows tzutil command

  3. Save edits to the table.
  4. Create a short integer field in each edge source feature class used by the network and populate the values of that field with the object ID value of the row in the time zone table that represents the correct time zone for the feature.
  5. Save edits to the feature classes, if necessary.
  6. Access network attributes on the Network Dataset Properties dialog box.
  7. Click the Time Zone tab.
  8. Check the Add Time Zone Attribute check box.
  9. From the Time Zone Table drop-down list, choose the time zone table you want to use.
  10. In the Evaluators section, set the Type column to use a Field Script evaluator for the Along direction of the edge sources in the network. Leave the Against direction of the edge sources set to Same as Along.
  11. In the Value column of the Evaluators section for the rows you set to Field Script in the previous step, set the value to the name of the field in the edge source that indicates the time zone of the feature. For example, if the source feature class uses a field called TimeZoneID to refer to the correct row in the time zone table, configure the evaluator to use this field by setting the value to !TimeZoneID!.

    Screenshot of time zone attribute configuration using a field script evaluator
    The time zone attribute is configured for this network dataset using a time zone table called TimeZones and a field script evaluator that references a field called TimeZoneID in the Routing_Streets edge source.

  12. Click OK.

    The time zone attribute is configured and saved to the network dataset.

  13. Build the network dataset.

    The network is now ready for use.

Configure the time zone attribute for a network in only one time zone

When the roads in a network are all within a single time zone, the time zone attribute can be configured using a constant evaluator that hard-codes the time zone for all network edges. A field in the edge source feature classes is not necessary to identify the time zone for each feature since all features are in the same time zone. A time zone table is required, but it needs only a single entry with the MSTimeZone field value set to the name of the single time zone relevant to the network. The Windows registry provides information to Network Analyst about the UTC offset and any date ranges for daylight saving time for this time zone.

  1. Create a time zone table in the network dataset's workspace.

    The table can have any name, but it must have a text field named MSTimeZone.

    You can create a table by right-clicking the geodatabase and choosing New > Table or using the Create Table geoprocessing tool.

  2. Add a row to the table and set the MSTimeZone field value to the correct time zone ID recognized by the Windows registry.

    To generate a list of time zone IDs recognized by the Windows registry, enter tzutil /l in a Windows command prompt. The ID is the second value returned for each time zone.

    Screenshot of output from Windows tzutil command

    Screenshot of the attribute table of a time zone table with a single row
    The time zone table is called TimeZones and has the required MSTimeZone field. This time zone table will be used for a network whose edges are entirely contained within the Pacific Standard Time zone, so the table has one row with a value of Pacific Standard Time.

  3. Save edits to the table.
  4. Access network attributes on the Network Dataset Properties dialog box.
  5. Click the Time Zone tab.
  6. Check the Add Time Zone Attribute check box.
  7. From the Time Zone Table drop-down list, choose the time zone table you want to use.
  8. In the Evaluators section, confirm that the row labeled <Default> in the Source column is configured with a Constant evaluator in the Type column and that the Value column shows the display name of the desired time zone for the network dataset. Leave the Along direction of the edge sources in the network set to Same as Default and the Against direction of the edge sources set to Same as Along.

    Because the time zone table has only one row, the network dataset chooses this row as the default time zone automatically.

    Screenshot of time zone attribute configuration using a constant evaluator
    The time zone attribute is configured for this network dataset using a time zone table called TimeZones and a constant evaluator that is hard-coded to a specific time zone. The edge source uses the default edge evaluator because all the edges are within the same time zone.

  9. Click OK.

    The time zone attribute is configured and saved to the network dataset.

  10. Build the network dataset.

    The network is now ready for use.