An expression is a way to specify conditions. For example, you can create an expression that specifies all buildings whose area is larger than 4000 square feet. When you use Select by Filter, that expression selects only buildings that are larger than 4000 square feet.
Use expressions in the following situations:
Use the Source Filter field on the Source tab to select the data to include in the model. For example, to import only residential buildings, use the expression USE_TYPE = 'R' (if R stands for Residential).
For example, the model has a property called ROOF_HEIGHT. The original data has FLOOR_HEIGHT and FLOORS. You can multiply FLOOR_HEIGHT * FLOORS to get ROOF_HEIGHT.
For example, during import, specify that the Name field will contain the phrase "Type of Building: " followed by the value for USE_TYPE.
For example, create a subset of roads that lie within a geographical area you draw on the model.
For example, select all trees whose NAME property is Ficus.
All style rules use expressions to determine how styles are applied. For example, create a style for trees that maps the species (NAME property) to a visual tree style.
The Expression Editor can calculate values, based on existing properties. It can convert data from one data type to another. Use text expressions to format text strings. Use numeric expressions to apply math functions to properties with numeric values.
The title bar for the dialog box in which you create expressions is different, depending on the command you choose. The contents of the dialog box are much the same, no matter what it is called.
The text in the title bar changes, depending on which command you select.
Use expressions in the following ways:
Ways to Use Expressions | Description |
---|---|
Evaluating Properties |
You can filter or select data based on the value of one or more properties. A simple expression evaluates a single property, but you can create complex expressions that use multiple properties or multiple values. For example, you could create an expression that shows buildings with a roof height over 18 but under 32. The result of a filter expression must be a Boolean value. |
Creating a Calculation |
You can calculate a new value based on existing values. For example, you can do the following:
|
Performing a Conversion |
Conversions change data values from one data type to another. For example, if a data store keeps date values as text, you can convert these values to date strings. Then you can use Date Functions on them. You can also convert numeric or text strings to a particular numeric format, for example to a single- or double-precision number. You can convert numeric values into text strings, for example, to extract a substring or find the number of characters in the string. |
Creating Text Expressions |
With text expressions, you can analyze and manipulate strings. For example, you can do the following:
|
Creating Numeric Expressions |
Numeric expressions operate only on numeric values. They use math functions, with which you can analyze and manipulate numeric strings. For example, with numeric expressions, you can do the following:
|
Using Expressions to Filter Data |
With filters, you can work with a subset of your data. For example, if your model includes all the buildings in a city, you can create a filter to show only buildings in the downtown area. Use expressions to do the following: |