Skip to content

Module 1b, Learning the basic concepts of GeoDMS, understanding units

Jip Claassens edited this page Jul 3, 2024 · 11 revisions

learning objective: understanding units and how to use them in the GeoDMS

introduction

The GeoDMS calculates with data items. Items are structured to understand the semantics of those data items, and units are used to check the calculation logic. A unit in the GeoDMS defines the type, meaning and range of the data used in the model. In previous modules, we learned that for data items, we always need to configure a values unit and, if the data item is an attribute, also a domain unit. Values units and domain units are not two separated worlds of units; they only differ in the role they play. To make this clear, we will use an example of an attribute with the area of each province in the Netherlands.

values unit

In its role as a values unit, it defines how to interpret the values of a data item. In this example, the value unit is square meters (or a similar unit like hectare or km2). This values unit gives meaning to a value in the attribute. The area of a province is not x but x square meters. Each unit configured in a GeoDMS configuration can be used as a values unit. A values unit consists of two components:

  1. required, the value type. This type indicates which type of data is described by the value's unit, for example, numeric, string, or boolean data. If the data is numeric, it also describes if the data is a (un)signed integer, floating point or two-dimensional (coordinates) and the size (in bits) needed to store the data. See value types for an overview of all available types.
  2. optional, the metric. To understand the metric concept, think about your high school's physics lessons. Like with data, you can also calculate with units. Starting with a set of base units, other units can be derived and used as valid units for derived calculations. The square meter unit in our example is based on the multiplication of two times the base unit meter. The metric plays an important role in understanding data items and in checking modelling logic.

With the value's unit, you implicitly or explicitly define the set of allowed values, the so-called range. The value type table lists each value type's default minimum and maximum values. By configuring the range, you can explicitly limit the default range of the value type. In our example, the range of the square meters could be configured to zero and higher (as values indicating square meters could not be negative).

This could be used to check for model inconsistencies.

Reading tip: for more information and examples, see values unit and metric

domain unit

Some units also serve a role in determining the number of elements (cardinality) of the data item. This role is called the domain unit. In our example, the domain unit is the Province. Each attribute with this domain unit describes an aspect of a province in the Netherlands. It is thus a set of 12 elements in a defined order. The domain unit configures the entity/table to which the attribute belongs. It defines the number of elements and the order or position within an attribute. This definition results in a selection of value types that can be used for units to serve in a role as domain units. See the column CanBeDomainUnit in the table value type. The number of elements of the domain unit is usually explicitly configured with the NrofRows property in the Range function or derived from a data source.

Reading tip: for more information and examples, see domain unit

try it yourself!

In this exercise, you will learn how to configure and use units.

  • Download the project here and unzip the downloaded project file to a projDir like C:/prj/GeoDMSAcadamy.
  • Open the file exercise.dms (in the GeoDMS_Academy\basics_understanding_units\cfg subfolder of your downloaded project) with a text editor. A source file with OSM highways for Amsterdam is configured in this configuration.
  • Configure the units needed to calculate the travel time along each highway segment. Use 100 km/hr as the travel speed. Tip: Calculate the road length using the Arc length function.
  • In the data subfolder, you also find a shape file with provinces. Configure a province domain unit based on this province shape file. Hint: see ESRI Shapefile.

First, try to figure it out yourself. The configuration with the results is also available in the downloaded project; open the result.dms file with the GeoDMS GUI in the cfg subfolder of your downloaded project. The result configuration shows an example of a working implementation.


Go to previous module: Module 1a, Learning the basic concepts of GeoDMS, naming items and namespaces

Go to next module: Module 1c, Learning the basic concepts of GeoDMS, calculations over multiple domains

Clone this wiki locally