<< Click to display Table of content >> List of expressions |
![]() ![]() ![]() |
Here are listed a selection of useful properties and functions that can be used in expressions.
More properties and functions available can be found here.
Properties
There are three main types of properties, each one symbolized by a suffix character:
•& represents a numerical number.
•# represents a decimal number.
•$ represents a string.
Geometry
Name |
Syntax |
Description |
Area |
_area# |
Gets the area covered by the items on an overlay, in square metres. |
Clockwise |
_bClockwise& |
Is the item geometry defined in a clockwise direction? Returns -1 (True) for clockwise, 0 (False) for anti-clockwise. |
Closed |
_closed& |
Does the geometry of the item form a closed loop? Returns -1 (True) for closed loop, 0 (False) for not closed loop. |
Length |
_lenght# |
The length of the geometry, in metres. |
Number of loops |
_numloops& |
The number of loops used by a Polygon item. Many polygon items have only one loop. However, any holes or islands will be stored as extra loops. |
Origin X Origin Y Origin Z |
_ox# _oy# _oz# |
The X/Y/Z coordinate of the item's origin, in metres from the dataset origin. |
Simple |
_bSimple& |
Is the item geometry simple? A non-simple geometry means the item has crossed lines or kickbacks. Returns -1 (True) for simple geometry, 0 (False) for non-simple geometry. |
Size in X Size in Y Size in Z |
_sx# _sy# _sz# |
The size of the item in the X/Y/Z direction, in metres. |
Text
Name |
Syntax |
Description |
Text |
_text$ |
The textual content of the item. |
Functions
Date
Name |
Syntax |
Description |
Date |
Date(date) |
The date/time number of the current date/time, or of the given date/time as a property or as a literal date string. Date() returns the current date and time. |
Now |
Now() |
Returns a date for the current date and time. |
ParseDate |
ParseDate(str$) |
Converts a string into a date. |
Inspection
Name |
Syntax |
Description |
Exists |
Exists(property) |
Does the given property exist on this item? Returns -1 (True) if the property exists on the current item, 0 (False) if the property does not exist on the current item. Example: Exists(_text$) will only return True for Text, BoxText, Label and LineText items |
IsNull IsNotNull |
"expression" Is Null "expression" Is Not Null |
Tests whether a property value or expression is Null/not Null. |
Maths
Name |
Syntax |
Description |
Log10 |
Log10(number) |
Gets the base-10 logarithm of a number. |
Round |
Round(number, decimals) |
Round a number. Example: Round(_length#, 2) round the value of length# to two decimal places. |
Program
Name |
Syntax |
Description |
Iif |
Iif(expression, truepart, falsepart) |
Returns one of two parts, depending on the evaluation of an expression. Example: Iif(_length#>1000,"This Line is long", "This Line is short") returns the string "This Line is long" if the _length# geometry property exceeds 1000 metres. Otherwise the string "This Line is short" will be returned. |
Scope
Name |
Syntax |
Description |
JoinItem |
JoinItem(overlay) |
Allows access to the properties/attributes of an item from another overlay. Example: JoinItem(Overlay("dbNight",{MITHRA::no_receiver&=this.MITHRA::no_receiver&})).Val# returns the acoustic value of an item from overlay "dbNight" that have the same receiver number as the current item. Example 2 : JoinItem(Overlay('buildings',{ST_Intersects(geometry,this.geometry)})).MITHRA::no_building& returns the number of the building in intersection with the current object. Be careful to fill in the full name of the overlay. |
this |
this.property |
Gets a property from an item. Normally everything inside braces {...} is executed on item(s) in another overlay. However, if you use this, then you can 'point back' to the original, current overlay. Example: Overlay("dbNight",{MITHRA::no_receiver&=this.MITHRA::no_receiver&}) 'this.MITHRA::no_receiver&' evaluates to the receiver number of the current item in the current overlay, and 'MITHRA::no_receiver&' evaluates to the receiver number of items in the overlay 'dbNight'. |
Spatial
Name |
Syntax |
Description |
FindItem |
FindItem(Overlay(name, {filter}), geometrytest, geometrymode) |
Finds an item on another overlay that satisfies a spatial test with the current item. The found item will depend upon the chosen geometrytest and geometrymode. Where more than one item passes the spatial test, only a single item will be found. name: The overlay to be searched. filter: An optional filter to apply to items on the overlay being searched. geometrytest: The spatial test to apply: 0 Equal: The two items' geometry must be the same. 1 Disjoint: The items must be completely separate, with daylight between them. 2 Intersect: The items must not be disjoint, so they must have a point in common. This is the fastest, and most common test. 3 Touch: The items' interiors must be disjoint, and their boundaries must intersect. 4 Cross: If the items are Line items, then they must intersect without being tangential. Otherwise, their interiors must intersect, with the current item going outside the overlay item. 5 Crossed By: If the items are Line items, then they must intersect without being tangential. Otherwise, their interiors must intersect, with the overlay item going outside the current item. 6 Within: The interior of the current item must be strictly inside the overlay item. 7 Contain: The interior of the overlay item must be strictly inside the current item. 8 Overlap: If the two items are Line items, then they must be tangential, and neither should contain the other. Otherwise, their interiors must intersect, with neither containing the other. geometrymode: The testing mode to apply: 0 Origin: The origin of the overlay item (always a single point) must pass the testing method with the current item. 1 Extent: The extents of the overlay item (always a rectangle) must pass the testing method with the current item. 2 Geometry: The geometry of the overlay item must pass the testing method with the current item. Example: FindItem("LAeq Night", 0, 0).Val# returns the acoustic value of the item from overlay "LAeq Night" whose origin is located at the exact same location of the current item. |
Overlay |
Overlay(name, {filter}) |
A reference to another overlay, used for finding items, with an optional filter. Example: Overlay("dbNight",{MITHRA::no_receiver&=this.MITHRA::no_receiver&}) returns the items of the overlay "dbNight" that have the same receiver number as the current item. |
OverlapArea |
OverlapArea(Overlay('nom'), {filtre}) |
Determine the area in m² of overlap between the current object and the tested object. Exemple : OverlapArea(Overlay('reference', {ST_Intersects(geometry,this.geometry)}) |
String
Name |
Syntax |
Description |
FormatDate |
FormatDate(date,format) |
Formats a date number as a string. Example: FormatDate(date(), "%d-%m-%Y") would return day month year of the current date: 26-06-2020 |
Str |
Str(number) |
Gets the string representation of a number. |
Val |
Val(string) |
Gets the numerical value of a string. |