Attribute

From Tygron Support wiki
Jump to navigation Jump to search
Please note: This page is currently being updated.


Template:Learned

What is an Attribute?

An attribute is a characteristic of a particular component in the 3D world like an area or a construction. An attribute is always a number and can have a positive or a negative value.

Attributes in relation to the Tygron Engine

Attributes contain information about a particular component which can be used in Excel calculations. The value of an attributed can be changed as a result of an Excel calculation or as the result of an event. Some of the attributes and their value at the start of the project are added by default. It is also possible to add or adjust attributes and the value manually. In addition, there is also the possibility to import attributes as part of importing GeoJSON files. The Engine's components which have attributes include: neighborhoods, areas, constructions and zones.

Attribute values

An attribute always consists of a name and a value. The value must always be a number. It can be either a positive or a negative number. When an attribute does not exist, its value is deemed to be 0. Note that this means that an attribute value of 0 can mean that the proper value of the attribute is 0, or that the attribute does not exist.

When you want to make use of an attribute in an Excel indicator you need to specify in the spreadsheet if the attribute is included in the calculation or not. This is done by the ACTIVE attribute. For the ACTIVE attribute the input is always 1 for active and 0 for not active.

How to add and remove attributes

This panel allows you to add new attributes.
Switch to the Attributes tab to create or edit attributes.

Attributes can be added to neighborhoods, areas, constructions and zones. In order to add, remove, or change an attribute for one of these Engine components, select the component in the left panel, and then select the attributes tab in the right panel. The attributes of that component will be displayed.

Adding attributes

Enter the desired name for the new attribute.

To create a new attribute, enter the desired name for the new attribute in the "Add new Attribute with Name" field.

Enter the desired value for the new attribute.

To create a new attribute, enter the desired value for the new attribute in the "Add new Attribute with Value" field.

Enter the desired value for the new attribute.

Once an attribute name and a valid attribute value have been entered in the appropriate fields, the "Save New Attribute" button becomes available. Selecting it will add the attribute to the list of existing attributes for the component.

Removing attributes

Enter the desired value for the new attribute.

To remove all attributes from a component, select the "Reset Variables" button.

Note that when you remove attributes which are related to properties of the component, the value of the properties will be changed as well, as though the attribute was set to "0".

It is currently not possible to remove individual attributes from a component. When desired, it is possible to set individual attributes to "0".

How to add a new attribute:
  1. Enter a name for the new attribute.
  2. Enter a value for the new attribute.
  3. Select "Save New Attribute".
How to remove an attribute:
  1. Select "Reset Variables".

Importing Attributes

File:Import area file.jpg
This panel allows you to select the attribute that you want to import

When creating areas using GeoJSON, it is possible to have attributes created based on the same file. In the GeoJSON import window, you will have the option to select attributes of the imported shapes, and to store them as attributes in areas. The same restrictions apply for importing attributes as when normally creating or editing attributes. I.e. the values must be valid numbers.

How to add attributes with a GeoJSON file:
  1. Option 1) Select the GeoJSON file in the folder Option 2)
    Hoover over the desired component in the Editor and Select import GeoJSON file
  2. In of case option 1 Drag and Drop the file in the Tygron Engine
  3. Select the desired input
  4. Make sure the attribute checkbox is checked
  5. Select the right attribute name
  6. Select the right attributes to import
  7. Select Send to import the attributes together with the imported area.


Edit attributes

Each attribute is listed with a name and a value. The values of existing attributes can be changed.

The value of any attribute can be changed after it has been added to a component. In the list of attributes, the value field for any attribute can be selected. The value can be changed by entering a different value in the field. The value must be a valid number, or the new value is rejected immediately.

How to change the value of an attribute:
  1. Select the value of the attribute you wish to change.
  2. Change the value to a valid value.
  3. Press "Enter" to set the value.

Special attribute values

Some attributes may have a more exact spectrum of values which are valid. For example, the ACTIVE attribute is either 1 or a 0.

Note that for attributes like these, other number values are not automatically rejected. When the engine or a user-defined calculation depends on the attribute being within a specific range of values, and the actual value is a different, valid number, no guarantees can be made about the result.

Active

Applies to: Areas

Some components may have an "active" property. When that property indicates the component is active, the "ACTIVE" attribute's value is "1". When the component is inactive, the attribute's value is "0".

Color

Applies to: Areas, Neighborhoods, Zones

Many components with attributes automatically have a "COLOR" attribute added to them, the value of which is the same as the color property of that component. When that color property is changed, the attribute is changed, and vice versa.

The numeric value of the attribute corresponds with an RGB color value, calculated by combining the red, green and blue values of the desired color together, multiplied by powers of 256. The amount of red, green, and blue are values between 0 and 255, inclusive. These are added to a base value of -16777216. A proper color value can be calculated as follows: -16777216 + (red * 256²) + (green * 256) + (blue).

Urbanization

Applies to: Neighborhoods

The "URBANIZATION" attribute is an indication of how deep within a city a neighborhood lies. It ranges from 1 (dense urbanization) to 5 (virtually no urbanization).

Nature Reserve

Applies to: Areas

The "NATURE_RESERVE" attribute indicates whether an area is a protected area of nature. This usually means the allowance for pollution and noise is lower. Areas with an "NATURE_RESERVE" attribute value of "1" are deemed protected nature. When the attribute's value is 0, the area is not necessarily deemed protected nature.