Skip to content

Configuration file

mtbeek32 edited this page Jan 3, 2023 · 15 revisions

A configuration file is an ASCII file, used in the GeoDMS to store logical parts of the modelling logic.

A configuration file in the GeoDMS always has one and only one parent item.

Configuration file can include other configuration files by using the include statement.

Configuration files can be viewed or edited with a configuration file editor.

Configuration files always use the extension: .dms

contents

In a configuration file can be configured:

configuration files

Configuration files can also contain (small parts) of primary data.

small data items

For small data items like case parameters or class boundaries/labels in classifications it is common to store these values in configuration files, see example:

attribute  Classes (ClassUnit): DialogType = "Classification", [0,200,400,800]; attribute Label   (ClassUnit): DialogType = "LabelText",      ['0 - 200','200 - 400','400 - 800','> 800'];

Since version 7.199, is it also possible to configure data in such a way for domains with 0 entries, see next example:

unit empty_domain : nrofrows = 0  {     attribute int_data            : [ ];     attribute poly_data_OK (poly) : [ ]; }

Primary data for data items is configured between square brackets [ ], comma separated. String values need to be single quoted. Configure a value for each entry of the domain unit.

tabular data

Configuring attribute values as in the earlier example is not so user-friendly for tabular data with multiple attributes. With the following configuration example, primary data can be stored in a configuration file and be edited as a table:

unit supermarket: NrOfRows = 3 {     parameter nrAttr := 5;     unit elem := range(uint32, 0, nrAttr *#supermarkt) // domain of all cells in a table     {         attribute values: [          // 'name'      ,'street'           ,'housenr' ,'zipcode'  ,'place'            'Plusmarkt' ,'Amerikaplein'     , '2'      ,'6269DA'   ,'Margraten',           ,'Lidl'      ,'Wilhelminastraat' ,'63'      ,'6245AV'   ,'Eijsden',           ,'Spar'      ,'Dalestraat'       ,'23'      ,'6262NP'   ,'Banholt'         ];     }     attribute<.> id := id(.);

    attribute name    := elem/values[value(id * nrAttr + 0, elem)];     attribute street  := elem/values[value(id * nrAttr + 1, elem)];     attribute housenr := uint32(elem/values[value(id * nrAttr + 2, elem)]);     attribute zipcode := elem/values[value(id * nrAttr + 3, elem)];     attribute place   := elem/values[value(id * nrAttr + 4, elem)];    } }

In this example the primary data is configured for the supermarket/elem/values data item. The values are presented and can be edited as a table. All data values are configured as string values.

The trick here is that the data is not configured per attribute but for a new domain (elem), which is the domain of all cells in a table. This elem domain can be formatted in a tabular way (see example). Later on the correct values per attribute are selected from the elem domain, with lookup functions. Conversion functions are used to convert the original string values to their requested value type.

Clone this wiki locally