attribute - ObjectVision/GeoDMS GitHub Wiki

Attributes are data items referring to arrays of data values. Conceptually attributes are characteristics of an entity, think about a column in a table.

In the GeoDMS this means that each attribute belongs to such a table, the so-called domain unit.

syntax

  • Start with the keyword: attribute
  • Configure between the less than (<) and greater than (>) characters its values unit.
  • Next configure the name of the attribute.
  • Configure between normal brackets its domain unit.
  • For attributes often expressions are configured, but also other properties can be configured.
  • To finalize the definition of an item, configure a semicolon (;) character.

example

attribute<hectare> building (grid_500m) := residential + utility;

The example configures an attribute called building. The values are expressed in hectares, so hectare is configured as values unit.

The domain unit for this attribute is grid_500m, defining a grid with cells of 500 * 500 meter.

The attribute results are calculated with an expression, building is defined as the sum of residential and utility.

an attribute without a domain

The domain unit between the brackets may be left out. The attribute then takes the nearest unit above it in the tree as its domain: its parent, when that is a unit, or else the first unit above the containers it is grouped in.

Since GeoDMS 20.20.0 the search continues above a container. Before, only the parent counted: an attribute in a container inside a unit failed with Cannot find Domain unit ., so every attribute in such a group had to name its domain, (..) or the name of the unit, or the group had to carry a unit of its own. A group of attributes on the domain of the unit can now be written as:

unit<uint32> building: nrofrows = 1000
{
	attribute<float64> area := ...;

	container meta                        // groups attributes of building
	{
		attribute<string> name := ...;    // domain building, as if written (..)
		attribute<uint32> year := ...;
	}
}

An attribute with an explicit domain is not affected, and neither is an attribute whose parent is a unit. When no unit is found above the attribute at all, it fails as before, and the error now names what was searched:

Cannot find Domain unit .: an attribute without a domain specification takes the nearest ancestor unit as its domain, but none of its ancestors is a unit (searched from /grp up to the configuration root)

Inside a template the search stops at the template itself: the attribute has no domain in the template body and finds one where the template is instantiated, above the instantiation.

A configuration written by the GeoDMS, such as the dictionary of an MMD storage, spells an attribute whose domain is the nearest unit above it with the dotted domain (.), whatever the configuration it was written from said; read back, (.) binds to that same unit.

⚠️ **GitHub.com Fallback** ⚠️