TQL Examples

From Tygron Support wiki
Revision as of 14:30, 25 June 2026 by Frank@tygron.nl (talk | contribs) (Grid Max)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

A number of use-cases come up frequently across various projects. Queries of the following forms often provide a firm basis for using TQL to obtain required data.

Select Active

Main article: Select active (TQL)

To query whether a Neighborhood with Item ID 5 is active, returning 1 if active, 0 otherwise:

SELECT_ACTIVE_WHERE_NEIGHBORHOOD_IS_5

To query whether each Neighborhood is active, returning an array of 0 and 1's:

SELECT_ACTIVE_WHERE_NEIGHBORHOOD_IS_X

To query whether an Indicator with Item ID 8 is active, returning 1 if active, 0 otherwise:

SELECT_ACTIVE_WHERE_INDICATOR_IS_8

To query whether an Scenario with Item ID 0 is active, returning 1 if active, 0 otherwise:

SELECT_ACTIVE_WHERE_SCENARIO_IS_0

To query whether a test-run or single/multi stakeholder session is active, returning 1 if active, 0 otherwise:

SELECT_ACTIVE_WHERE_SCENARIO_IS_ACTIVE

To query whether a Heat Network is active, returning 1 if active, 0 otherwise:

SELECT_ACTIVE_WHERE_NET_TYPE_IS_HEAT

To query whether an Overlay with Item ID 25 is active, returning 1 if active, 0 otherwise:

SELECT_ACTIVE_WHERE_OVERLAY_IS_25

To query whether an Area with Item ID 4 is active, returning 1 if active, 0 otherwise:

SELECT_ACTIVE_WHERE_AREA_IS_4

To query whether Areas with the Attribute DESTINATION are active, returning an array of 0 and 1's:

SELECT_ACTIVE_WHERE_AREA_IS_XA_DESTINATION

Select Attribute

Main article: Select attribute (TQL)

To query the value of the attribute INHABITANTS for the Neighborhood with Item ID 0, returning a decimal number:

SELECT_ATTRIBUTE_WHERE_NEIGHBORHOOD_IS_0_AND_NAME_IS_INHABITANTS

To query the value of the attribute FLOOR_SPACE_M2 for an Address with Item ID 415, returning a decimal number:

SELECT_ATTRIBUTE_WHERE_ADDRESS_IS_415_AND_NAME_IS_FLOOR_SPACE_M2

To query the value of the attribute POWER for each Net Load of the HEAT Net Type, returning an array of decimal numbers:

SELECT_ATTRIBUTE_WHERE_NET_LOAD_IS_X_AND_NET_TYPE_IS_HEAT_AND_NAME_IS_POWER

In case an overlay with a particular Grid Type is not unique in your project, a Grid Overlay can alternatively be identified using the GRID_WITH_ATTRIBUTE clause. To query the value of the attribute TIMEFRAMES for a Grid Overlay that has the unique Attribute named SPECIAL_OVERLAY

SELECT_ATTRIBUTE_WHERE_GRID_WITH_ATTRIBUTE_IS_SPECIAL_OVERLAY_AND_NAME_IS_TIMEFRAMES

To query an attribute named PARAMETER_1 of the first Building of a Measure:

SELECT_ATTRIBUTE_WHERE_MEASURE_IS_5_AND_RELATION_IS_BUILDING_AND_NAME_IS_PARAMETER_1

To query the Dates model attribute of a Heat Stress Overlay for each timeframe, return an array of decimal numbers:

SELECT_ATTRIBUTE_WHERE_GRIDTYPE_IS_HEAT_STRESS_AND_NAME_IS_DATES_AND_TIMEFRAME_IS_X

Attribute Advanced

Culverts are buildings that are identified using the key CULVERT_DIAMETER, configured for a Water Overlay, such as a Rainfall Overlay. To query each Culvert (Water Overlay) for the value of the attribute configured for the Rainfall Overlay Key OBJECT_FLOW_OUTPUT, returning an array of decimal numbers:

SELECT_ATTRIBUTE_WHERE_BUILDING_IS_XK_CULVERT_DIAMETER_AND_GRIDTYPE_IS_RAINFALL_AND_KEY_IS_OBJECT_FLOW_OUTPUT

To query the values of the Rain m attribute of the Weather configured for a Rainfall Overlay, returning an array of 100 decimal numbers:

SELECT_ATTRIBUTE_WHERE_NAME_IS_RAIN_M_AND_GRIDTYPE_IS_RAINFALL_AND_RELATION_IS_WEATHER_AND_INDEX_IS_X

Weirs are buildings that are identified using the key WEIR_HEIGHT, configured for a Water Overlay, such as a Groundwater Overlay. To query the weight height of each Weirs covered by a Water Level Area, related to a Groundwater Overlay: (This query can only be applied by a Template Panel set up for Areas, hence the AREA_IS_ID clause)

SELECT_ATTRIBUTE_WHERE_KEY_IS_WEIR_HEIGHT_AND_GRIDTYPE_IS_GROUNDWATER_AND_BUILDING_IS_XCK_WEIR_HEIGHT_AND_AREA_IS_ID

Color

Main article: Select color (TQL)

To query the COLOR attribute of an Area with Item ID 5, returning the color in HEX Format:

SELECT_COLOR_WHERE_AREA_IS_5

To query the color of a Stakeholder with Item ID 3, returning the color in HEX Format:

SELECT_COLOR_WHERE_STAKEHOLDER_IS_3

To query the default color of a Stakeholder Type MUNICIPALITY, returning the color in HEX Format:

SELECT_COLOR_WHERE_STAKEHOLDERTYPE_IS_MUNICIPALITY

Distance

Main article: Select distance (TQL)

To query the distance of an Area with Item ID 1 to a particular Building with Item ID 5:

SELECT_DISTANCE_WHERE_AREA_IS_1_AND_BUILDING_IS_5

To query the distance of an Address to each educational Building, identified using the Education Unit Size M2 attribute, returned as an matrix of address distances per educational building:

SELECT_DISTANCE_WHERE_BUILDING_IS_YA_EDUCATION_UNIT_SIZE_M2_AND_ADDRESS_IS_X

Expenses

Main article: Select expenses (TQL)

To query the total expenses made by a Stakeholder with Item ID 3, returning a decimal number:

SELECT_EXPENSES_WHERE_STAKEHOLDER_IS_3

Floorsize

Main article: Select floorsize (TQL)

To query the amount of office space within a Neighborhood with Item ID 4, returning a decimal number:

SELECT_FLOORSIZE_WHERE_CATEGORY_IS_OFFICE_AND_NEIGHBORHOOD_IS_4

To query the total floor size of student housing owned by Housing Corporations, returning a decimal number:

SELECT_FLOORSIZE_WHERE_CATEGORY_IS_STUDENT_AND_STAKEHOLDERTYPE_IS_HOUSING_CORPORATION

To query the floor size of each Category owned by a Stakeholder, for each Stakeholder, returning an array of arrays of decimal numbers, one array per Stakeholder:

SELECT_FLOORSIZE_WHERE_CATEGORY_IS_X_AND_STAKEHOLDER_IS_Y

To query the buyout costs for Buildings that are marked as monumental, returning a decimal number:

SELECT_FLOORSIZE_WHERE_CATEGORYMULT_IS_BUYOUT_COST_M2_AND_ATTRIBUTE_IS_MONUMENTAL

To query the amount of parking lots of Buildings of the Function 'Parking Garage' with Item ID 665, returning a decimal number:

SELECT_FLOORSIZE_WHERE_CATEGORYMULT_IS_PARKING_LOTS_PER_M2_AND_FUNCTION_IS_665

To query the amount of parking lots required by residental Buildings, for each Neighborhood, returning an array of decimal numbers:

SELECT_FLOORSIZE_WHERE_CATEGORYMULT_IS_PARKING_LOTS_DEMAND_PER_M2_AND_RESIDENCE_IS_TRUE_AND_NEIGHBORHOOD_IS_X

To query the amount of floor space of residences in areas of low livability (for example -0.5), according to a Livability Overlay, returning a decimal number:

SELECT_FLOORSIZE_WHERE_GRIDTYPE_IS_LIVABILITY_AND_MAXGRIDVALUE_IS_MINUS_0.5_AND_RESIDENCE_IS_TRUE

Advanced Floorsize

To query the floorsize of a Building related to an Panel instance of a Template Panel applied on Buildings, returning a decimal number:

SELECT_FLOORSIZE_WHERE_PANEL_IS_ID_AND_RELATION_IS_BUILDING

Global

Main article: Select global (TQL)

To query the value of a Global named MODEL_CONSTANT, returning a decimal value:

SELECT_GLOBAL_WHERE_NAME_IS_MODEL_CONSTANT

To query the value of a Global named SPECIFIC_VALUE, only at iteration 3 when a project has 4 or more iterations, returning a decimal value when the iteration is 3 and nothing otherwise:

SELECT_GLOBAL_WHERE_NAME_IS_SPECIFIC_VALUE_AND_ITERATION_3

To query each value of a Global named MULTIPLE_VALUES that has multiple values, returning an array of decimal values (the first 100 defined for the Global):

SELECT_GLOBAL_WHERE_NAME_IS_MULTIPLE_VALUES_AND_INDEX_IS_X

Grid Area

Main article: Select gridarea (TQL)

To query the surface size of grid cells with a Heat Stress Overlay PET Temperature above 41 degrees for timeframe 3, returning a decimal number:

SELECT_GRIDAREA_WHERE_GRIDTYPE_IS_HEAT_STRESS_AND_RESULTTYPE_IS_PET_AND_MINGRIDVALUE_IS_41.0_AND_TIMEFRAME_IS_3

To query the surface size of grid cells with a Heat Stress Overlay PET Temperature below 30 degrees for each timeframe, returning an array of decimal numbers:

SELECT_GRIDAREA_WHERE_GRIDTYPE_IS_HEAT_STRESS_AND_RESULTTYPE_IS_PET_AND_MAXGRIDVALUE_IS_30.0_AND_TIMEFRAME_IS_X

To query the surface size of grid cells labeled as '1' by an AI Inference Overlay for a neighborhood with Item ID 3, returning a decimal number:

SELECT_GRIDAREA_WHERE_GRIDTYPE_IS_INFERENCE_AND_RESULTTYPE_IS_LABELS_AND_GRIDVALUE_IS_1.0_AND_NEIGHBORHOOD_IS_3

Grid Avg

Main article: Select gridavg (TQL)

Grid Min

Main article: Select gridmin (TQL)

To query the minimum (ignoring NO_DATA values) of a Grid Overlay with Item ID 10, return a decimal number:

SELECT_GRIDMIN_WHERE_GRID_IS_10

To query the minimum temperature each timeframe for a Heat Stress Overlay, return an array of decimal values:

SELECT_GRIDMIN_WHERE_GRIDTYPE_IS_HEATSTRESS_AND_RESULTTYPE_IS_PET_AND_TIMEFRAME_IS_X

To query the minimum temperature each timeframe of a Heat Stress Overlay, for each Area with the Attribute TEMPERATURE_MEASUREMENT, returning an array of arrays of decimal values, one array per Area:

SELECT_GRIDMIN_WHERE_GRIDTYPE_IS_HEATSTRESS_AND_RESULTTYPE_IS_PET_AND_TIMEFRAME_IS_X_AND_AREA_IS_YA_TEMPERATURE_MEASUREMENT

Grid Max

Main article: Select gridmax (TQL)

To query te maximun value of a Grid Overlay with Item ID 12, return a decimal number:

SELECT_GRIDMAX_WHERE_GRID_IS_12

To query the maximum temperature each timeframe for a Heat Stress Overlay, return an array of decimal values:

SELECT_GRIDMAX_WHERE_GRIDTYPE_IS_HEATSTRESS_AND_RESULTTYPE_IS_PET_AND_TIMEFRAME_IS_X

To query the maximum water level for each Area with the attribute WATER_LEVEL_MEASUREMENT, given a calculated Rainfall Overlay that has the result child Surface Last Datum, for each timeframe, returning an array of arrays of decimal values, one array per Area:

SELECT_GRIDMIN_WHERE_GRIDTYPE_IS_RAINFALL_AND_RESULTTYPE_IS_SURFACE_LAST_DATUM_AND_TIMEFRAME_IS_X_AND_AREA_IS_YA_WATER_LEVEL_MEASUREMENT

Grid Volume

Main article: Select gridvolume (TQL)

To query the volume of water on the surface for each Neighborhood and each timeframe for a Rainfall Overlay, returning an array of arrays with decimal values, one per Neighborhood, consisting of calculated volumes for each timeframe:

SELECT_GRIDVOLUME_WHERE_GRIDTYPE_IS_RAINFALL_AND_RESULTTYPE_IS_SURFACE_LAST_VALUE_AND_NEIGHBORHOOD_IS_Y_AND_TIMEFRAME_IS_X

To query the volume of rainfall per Water Level Area of a Rainfall Overlay at the last timeframe, returning an array of decimal values, one per Water Level Area:

SELECT_GRIDVOLUME_WHERE_GRIDTYPE_IS_RAINFALL_AND_RESULTTYPE_IS_RAIN_AND_AREA_IS_XK_WATER_LEVEL

To query the volume of water in sewer per Sewer Area of a Rainfall Overlay at each timeframe, returning an array of arrays with decimal values, one per Sewer Area, consisting of calculated volumes for each timeframe:

SELECT_GRIDVOLUME_WHERE_GRIDTYPE_IS_RAINFALL_AND_RESULTTYPE_IS_SEWER_LAST_VALUE_AND_AREA_IS_YK_SEWER_STORAGE_AND_TIMEFRAME_IS_X

Grid Standard Deviation

Main article: Select gridstdev (TQL)

Height

Main article: Select height (TQL)

To query the height of a particular Building, returning a decimal number:

SELECT_HEIGHT_WHERE_BUILDING_IS_1770

To query the surface height (DSM) of water terrains within a particular Neighborhood with Item ID 5, returning a decimal number:

SELECT_HEIGHT_WHERE_TERRAIN_WITH_ATTRIBUTE_IS_WATER_AND_NEIGHBORHOOD_IS_5

To query the height change made to the Digital Surface Model by actions in a session, one average height value per Map Type, returning an array of decimal numbers:

SELECT_HEIGHT_WHERE_MAPTYPE_IS_X_AND_LEVEE_IS_Y

To query the height change made to the Digital Surface Model by applying levees, per Map Type and per Levee Type, returning an array of arrays of decimal numbers:

SELECT_HEIGHT_WHERE_MAPTYPE_IS_X_AND_LEVEE_IS_Y

ID

Main article: Select id (TQL)

To query the Item ID of a Neighborhood, returned as an Integer:

SELECT_ID_WHERE_NEIGHBORHOOD_IS_2

To query the Item ID of a Grid Overlay with the attribute SPECIAL_INTEREST, returned as an Integer:

SELECT_ID_WHERE_GRID_WITH_ATTRIBUTE_IS_SPECIAL_INTEREST

To query the Item ID of the Active Scenario, returned as an Integer:

SELECT_ID_WHERE_SCENARIO_IS_ACTIVE

To query the Item ID of the Stakeholder owning the Building with Item ID 6, returned as an Integer:

SELECT_ID_WHERE_BUILDING_IS_6_AND_RELATION_IS_STAKEHOLDER

To query the Item IDs of each Measure in a project, returned as an array of Integers:

SELECT_ID_WHERE_MEASURE_IS_X

To query the Item IDs of Buildings related to Net Loads of a particular Net Cluster with Item ID 1, returned as an array of Integers:

SELECT_ID_WHERE_NET_LOAD_IS_X_AND_NET_CLUSTER_IS_1_AND_RELATION_IS_BUILDING

To query the Item ID of the Parent Grid Overlay of the Grid Result Overlay with type Shade, returned as an Integer:

SELECT_ID_WHERE_RESULTTYPE_IS_SHADE_AND_RELATION_IS_RESULT_PARENT

To query the Item IDs of Functions identifible as Culverts by the Rainfall Overlay, returned as an array of Integers:

SELECT_ID_WHERE_FUNCTION_IS_XK_CULVERT_DIAMETER_AND_GRIDTYPE_IS_RAINFALL

Iteration

Main article: Select iteration (TQL)

To query the currently active iteration of the performed calculation, returning an integer:

SELECT_ITERATION_WHERE

Iterations

Main article: Select iterations (TQL)

To query the total amount of iterations set for your project, returning an integer:

SELECT_ITERATIONS_WHERE

Land Polygons

Main article: Select landpolygons (TQL)

Land Size

Main article: Select landsize (TQL)

To query the size of the project area, returned as a decimal number

SELECT_LANDSIZE_WHERE_

To query the land size of water terrains, returned as a decimal number:

SELECT_LANDSIZE_WHERE_TERRAIN_WITH_ATTRIBUTE_IS_WATER

To query the land size per water terrain, returned as an array of decimal numbers:

SELECT_LANDSIZE_WHERE_TERRAIN_IS_XA_WATER

To query the land size of water terrain per Water Level Area of a Rainfall Overlay, returned as an array of decimal numbers:

SELECT_LANDSIZE_WHERE_TERRAIN_WITH_ATTRIBUTE_IS_WATER_AND_GRIDTYPE_IS_RAINFALL_AND_AREA_IS_XK_WATER_LEVEL

Consider the situation in which a Rainfall Overlay has a timeframe at the start of the simulation, before any rainfall has occurred (by using a custom Rain M). To query the landsize of water terrain grid cells not initialized by a Water Level Area:

SELECT_LANDSIZE_WHERE_MAXGRIDVALUE_IS_0.001_AND_GRIDTYPE_IS_RAINFALL_AND_RESULTTYPE_IS_SURFACE_LAST_VALUE_AND_TERRAIN_WITH_ATTRIBUTE_IS_WATER_AND_TIMEFRAME_IS_0

Latitude

Main article: Select latitude (TQL)

To query the latitude (east-west) of the centerpoint of an Area with Item ID 0, in LOCAL coordinates, returning a decimal number:

SELECT_LATITUDE_WHERE_AREA_IS_0

To query the latitude (east-west) of the centerpoint of an Address with Item ID 255, with the Coordinate Reference System (CRS): EPSG 4326, returning a decimal number:

SELECT_LATITUDE_WHERE_ADDRESS_255_AND_CRS_IS_4326

To query the latitude (east-west) of the centerpoint of each monumental building, with the Coordinate Reference System (CRS): EPSG 3587, returning an array of decimal numbers:

SELECT_LATITUDE_WHERE_BUILDING_IS_XA_MONUMENTAL_AND_CRS_IS_3857

Length

Main article: Select length (TQL)

To query the total length of Net Lines of a particular Net Function with ID 3, returning a decimal number:

SELECT_LENGTH_WHERE_NET_FUNCTION_IS_3

To query the total length of Net Lines of Net Type Gas, returning a decimal number:

SELECT_LENGTH_WHERE_NET_TYPE_IS_GAS

To query the length of a Net Line with ID 5, returning a decimal number:

SELECT_LENGTH_WHERE_NET_LINE_IS_5

To query the length of each Net Line with attribute COATED, returning an array of decimal number:

SELECT_LENGTH_WHERE_NET_LINE_IS_XA_COATED

Levees

Main article: Select levees (TQL)

To query the amount of surface size impacted by the placement of a Levee Type with ID 3, returned as a decimal number:

SELECT_LEVEE_WHERE_LEVEE_IS_3

To query the amount of surface size impacted by the placement of a Levee Type with ID 1, per type of Stakeholder, returned as an array of decimal numbers:

SELECT_LEVEE_WHERE_LEVEE_IS_1_AND_STAKEHOLDERTYPE_IS_X

Longitude

Main article: Select longitude (TQL)

To query the longitude (east-west) of the centerpoint of an Area with Item ID 0, in LOCAL coordinates, returning a decimal number:

SELECT_LONGITUDE_WHERE_AREA_IS_0

To query the longitude (east-west) of the centerpoint of an Address with Item ID 255, with the Coordinate Reference System (CRS): EPSG 4326, returning a decimal number:

SELECT_LONGITUDE_WHERE_ADDRESS_255_AND_CRS_IS_4326

To query the longitude (east-west) of the centerpoint of each monumental building, with the Coordinate Reference System (CRS): EPSG 3587, returning an array of decimal numbers:

SELECT_LONGITUDE_WHERE_BUILDING_IS_XA_MONUMENTAL_AND_CRS_IS_3857

Lotpolygons

Main article: Select lotpolygons (TQL)

Lotsize

Main article: Select lotsize (TQL)

To query the lot size per Building Category for a Neighborhood with Item ID 4, returning an array of decimal numbers:

SELECT_LOTSIZE_WHERE_CATEGORY_IS_X_AND_NEIGHBORHOOD_IS_4

To query the lot size of Solid Buildings for each Neighborhood, returning an array of decimal numbers:

SELECT_LOTSIZE_WHERE_ATTRIBUTE_IS_SOLID_AND_NEIGHBORHOOD_IS_X

OR

SELECT_LOTSIZE_WHERE_FUNCTIONMULT_IS_SOLID_AND_NEIGHBORHOOD_IS_X

To query the expected (non-rasterized) water storage of a Building with Item ID 130, returning a decimal number:

SELECT_LOTSIZE_WHERE_BUILDING_IS_130_AND_FUNCTIONMULT_IS_WATER_STORAGE_M2

Lotsize Categorymult

To query the amount of parking lots for a particular Neighborhood with Item ID 4, returning a decimal number:

SELECT_LOTSIZE_WHERE_CATEGORYMULT_IS_PARKING_LOTS_PER_M2

To query the amount of parking lots per Functions of the Category PAVED_AREA that provide Parking Lots, returning an array of decimal number:

SELECT_LOTSIZE_WHERE_CATEGORYMULT_IS_PARKING_LOTS_PER_M2_AND_FUNCTION_IS_XA_PAVED_AREA_PARKING_LOTS_PER_M2

OR

SELECT_LOTSIZE_WHERE_ATTRIBUTEMULT_IS_PAVED_AREA_PARKING_LOTS_PER_M2_AND_FUNCTION_IS_XA_PAVED_AREA_PARKING_LOTS_PER_M2

Name

Main article: Select name (TQL)

To query the name of the SOCIAL Category, returned as a String object:

SELECT_NAME_WHERE_CATEGORY_IS_SOCIAL

To query the name of a Neighborhood with the Item ID 2, returned as a String object:

SELECT_NAME_WHERE_NEIGHBORHOOD_IS_2

To query the name of each Neighborhood, returned as an array of String objects:

SELECT_NAME_WHERE_NEIGHBHORHOOD_IS_X

To query the name of each Neighborhood that has the attribute INHABITANTS, returned as an array of String objects:

SELECT_NAME_WHERE_NEIGHBHORHOOD_IS_XA_INHABITANTS

To query the name of a Grid Overlay with the attribute SPECIAL_INTEREST, returned as a String object:

SELECT_NAME_WHERE_GRID_WITH_ATTRIBUTE_IS_SPECIAL_INTEREST

To query the name of the Active Scenario, returned as a String object:

SELECT_NAME_WHERE_SCENARIO_IS_ACTIVE

To query the name of the Stakeholder owning the Building with Item ID 6, returned as a String object:

SELECT_NAME_WHERE_BUILDING_IS_6_AND_RELATION_IS_STAKEHOLDER

To query the name of each Measure in a project, returned as an array of String objects:

SELECT_NAME_WHERE_MEASURE_IS_X

To query the names of Buildings related to Net Loads of a particular Net Cluster with Item ID 1, returned as an array of String objects:

SELECT_NAME_WHERE_NET_LOAD_IS_X_AND_NET_CLUSTER_IS_1_AND_RELATION_IS_BUILDING

To query the names of the Parent Grid Overlay of the Grid Result Overlay with type Shade, returned as a String object:

SELECT_NAME_WHERE_RESULTTYPE_IS_SHADE_AND_RELATION_IS_RESULT_PARENT

To query the names of Functions identifiable as Culverts by the Rainfall Overlay, returned as an array of String objects:

SELECT_NAME_WHERE_FUNCTION_IS_XK_CULVERT_DIAMETER_AND_GRIDTYPE_IS_RAINFALL

Net State

Main article: Select net state (TQL)

To query the state of the Electricity Net Type of a Net Cluster with Item ID 2, returning a Timestate value as a String object:

SELECT_NET_STATE_WHERE_NET_CLUSTER_IS_2_AND_NET_TYPE_IS_ELECTRICITY

To query the state of the each Net Type of a Net Cluster with Item ID 1, returning an array of Timestate values, with each Timestate represented as a String object:

SELECT_NET_STATE_WHERE_NET_CLUSTER_IS_2_AND_NET_TYPE_IS_X

To query the state of the each Net Type for each Net Cluster, returning an array of arrays of Timestate values, one Timestate array per Net Cluster, with each Timestate in the array represented as a String object:

SELECT_NET_STATE_WHERE_NET_CLUSTER_IS_Y_AND_NET_TYPE_IS_X

Revenue

Main article: Select revenue (TQL)

To query the total revenue received by a Stakeholder with Item ID 4, returning a decimal number:

SELECT_EXPENSES_WHERE_STAKEHOLDER_IS_4

Score

Main article: Select score (TQL)

To query the score of an Indicator with Item ID 2, returning a decimal number:

SELECT_SCORE_WHERE_INDICATOR_IS_2

To query the score of each Indicator, grouped per Map Type (CURRENT and MAQUETTE), returned as an array of arrays of decimal numbers:

SELECT_SCORE_WHERE_INDICATOR_IS_X_AND_MAPTYPE_IS_Y

To query the score of Indicators with the attribute HOUSING, returned as an array of decimal numbers:

SELECT_SCORE_WHERE_INDICATOR_IS_XA_HOUSING

Session State

Main article: Select sessionstate (TQL)

The query the current state of a session, returned as an Integer representing the sessionstate:

SELECT_SESSIONSTATE_WHERE

State

Main article: Select state (TQL)

To query whether Net Loads of a Net Cluster with Item ID 3 are connected, returned as a String:

SELECT_STATE_WHERE_NET_CLUSTER_IS_3

To query the state of each Measure in a project, returned as an array of Strings:

SELECT_STATE_WHERE_MEASURE_IS_X

Target

Main article: Select target (TQL)

To query the target of an Indicator with Item ID 4, returning a decimal number:

SELECT_TARGET_WHERE_INDICATOR_IS_4

To query the target of each Indicator, returning an array of decimal numbers:

SELECT_TARGET_WHERE_INDICATOR_IS_X

To query the target of each Indicator with the attribute ENVIRONMENTAL, returning an array of decimal numbers:

SELECT_TARGET_WHERE_INDICATOR_IS_XA_ENVIRONMENTAL

Token

Main article: Select token (TQL)

To query the Session's API token to interact with the REST API, returning the token as a String:

SELECT_TOKEN_WHERE_

To query the Web token to interact with the Web endpoints, for the Stakeholder with Item ID 4, returning the token as a String:

SELECT_TOKEN_WHERE_STAKEHOLDER_IS_4

To query the Municipality Stakeholder's Web token to interact with the Web endpoints, returning the token as a String:

SELECT_TOKEN_WHERE_STAKEHOLDERTYPE_IS_MUNICIPALITY

Topfloor

Main article: Select topfloor (TQL)

To query the amount of floors of a Building with Item ID 2671, returning an Integer value:

SELECT_TOPFLOOR_WHERE_BUILDING_IS_2671

To query the amount of floors per Building with the attribute SOCIAL_CATEGORY_WEIGHT, returning an array of Integer value:

SELECT_TOPFLOOR_WHERE_BUILDING_XA_SOCIAL_CATEGORY_WEIGHT

Units

Main article: Select units (TQL)

Use this select to obtain the amount of (housing) units for a particular Building, Buildings within an area and other conditions. As a Building can belong to multiple Building Categories, internally the amount of units of a building is calculated by multiplying the floor space of a building with the Unit size (Category Value) and the corresponding Category weight (Category Value).

To query the amount of units for a particular Building with Item ID 1669, returning a decimal number:

SELECT_UNITS_WHERE_BUILDING_IS_1669

To query the amount of Affordable Housing units per neighborhood, returning an array of decimal numbers:

SELECT_UNITS_WHERE_CATEGORY_IS_SOCIAL_AND_NEIGHBORHOOD_IS_X

To query the amount of Affordable Housing Units that have a Unit Size between 1 and 100 m2, for a Neighborhood with Item ID 2, returning a decimal number:

SELECT_UNITS_WHERE_NEIGHBORHOOD_IS_2_AND_ATTRIBUTE_IS_SOCIAL_UNIT_SIZE_M2_AND_ATTRIBUTE_MIN_IS_1_AND_ATTRIBUTE_MAX_IS_100.0

To query the amount of units per Category for a particular Neigbhorhood with Item ID 2, returning an array of decimal numbers:

SELECT_UNITS_WHERE_CATEGORY_IS_X_AND_NEIGHBORHOOD_IS_2

To query the amount of housing units of Stakeholder Type Inhabitants with Solar Panels, returning a decimal number:

SELECT_UNITS_WHERE_STAKEHOLDER_TYPE_IS_INHABITANTS_AND_ATTRIBUTE_IS_SOLAR_PANEL

To query the amount of housing units of Monumental Buildings with Solar Panels, returning a decimal number:

SELECT_UNITS_WHERE_ATTRIBUTE_IS_SOLAR_PANELS_AND_BUILDING_WITH_ATTRIBUTE_IS_MONUMENTAL

To query the amount of housing units of Monumental Buildings with Solar Panels on a slanting roof, returning a decimal number:

SELECT_UNITS_WHERE_ATTRIBUTE_IS_SOLAR_PANELS_AND_BUILDING_WITH_ATTRIBUTE_IS_SLANTING_ROOF_HEIGHT_AND_ATTRIBUTE_MULT_IS_MONUMENTAL

To select the amount of units of Buildings, overlapped by the Area with Item ID 4, where only the overlapped parts of the building are taken into account, returning a decimal number:

SELECT_UNITS_WHERE_AREA_IS_4

To select the amount of units of Buildings planned for construction (by measures and other actions), returning a decimal number:

SELECT_UNITS_WHERE_STATE_IS_PENDING_CONSTRUCTION

To select the amount of housing units of Buildings constructed after 1990, where the minimal attribute value for Construction finish date (Building Attribute) is set as milliseconds after the epoch 1 January 1970, returning a decimal number:

SELECT_UNITS_WHERE_ATTRIBUTE_MIN_IS_6.311484E11_AND_ATTRIBUTE_IS_CONSTRUCTION_FINISH_DATE_AND_RESIDENCE_IS_TRUE

Units Advanced

To calculate the amount of housing units on top of Peat terrain (i.e. with a non-zero peat fraction attribute), first create a Combo Overlay configured for Terrains with Key A set to PEAT_FRACTION and the following formula: @A Next, to query the amount of housing units on top of Peat terrain using the Combo Overlay (that in this example has an Item ID 5), returning a decimal number:

SELECT_UNITS_WHERE_GRID_IS_5_AND_MINGRIDVALUE_IS_0.001

To query the amount of housing units connected to a Heat Network, grouped by Net Clusters, returning an array of decimal numbers:

SELECT_UNITS_WHERE_NET_CLUSTER_IS_X_AND_NET_TYPE_IS_HEAT

To query the amount of housing units connected to an Electricity Network, grouped by Net Clusters with a minimum required POWER attribute value of 10, returning an array of decimal numbers:

SELECT_UNITS_WHERE_NET_CLUSTER_IS_X_AND_NET_TYPE_IS_ELECTRICITY_AND_ATTRIBUTE_IS_POWER_AND_ATTRIBUTE_MIN_IS_10

Other

Function values (selecting)

Parking requirements of social housing

The parking demand is based on a function value of each function, and is defined as "parking places per m2". Parking demand is not based on the footprint of a building, but the size of a building. i.e. a building 4 floors high needs more parking than a building with the same footprint 2 floors high.

SELECT_FLOORSIZE_WHERE_CATEGORY_IS_SOCIAL_AND_CATEGORYMULT_IS_PARKING_LOTS_DEMAND_PER_M2

  • SELECT_FLOORSIZE: What we are basically looking for is the floorsize of the building.
  • CATEGORY_IS_SOCIAL: We only want to look at buildings which are of the category social housing. For that, a category clause is added.
  • CATEGORYMULT_IS_PARKING_LOTS_DEMAND_PER_M2: Lastly, we are not looking directly for the floorsize, but for the parking demand as a result of that floorsize.

Function values (updating)

Traffic intensity on roads

The traffic intensity is a function value which affects calculations related to traffic. Some use-cases require these values to be updated dynamically. This can be done per neighborhood. (In this example, the neighborhood in question has the ID 1.)

UPDATE_BUILDING_TRAFFIC_FLOW_WHERE_CATEGORY_IS_ROAD_AND_NEIGHBORHOOD_IS_1

  • UPDATE_BUILDING: We're changing an attribute of a building.
  • TRAFFIC_FLOW: The attribute we are changing is the TRAFFIC_FLOW, which is the technical name of a function value.
  • CATEGORY_IS_ROAD: We only want to update this value on roads.
  • NEIGHBORHOOD_IS_1: We are updating only in this specific neighborhood. Nothing outside the neighborhood is updated by this statement.

Grid average

Quality of livability in a neighborhood

The livability overlay calculates, for each grid cell, the average livability. The best indication of how well a certain region performs in terms of livability would be to average these values out. That way, its possible to compare places which are not the same size. (In this example, the neighborhood in question has the ID 1, and the grid of livability has the ID 4.)

SELECT_GRIDAVG_WHERE_NEIGHBORHOOD_IS_1_AND_GRID_IS_4

For any given neighborhood, different points of a grid may score differently.

  • SELECT_GRIDAVG: We're looking for the average score across the entire neighborhood.
  • NEIGHBORHOOD_IS_1: We don't need the average of the entire map, but only of a specific neighborhood.
  • GRID_IS_4: We need to specify the grid we wish to use the values of.

Grid values

The area of open water which is flooded by more than 20 cm of water

The rainfall overlay calculates what amounts of water ends up where. The overlay's results are in meters. If we wish to provide some minimum value, it must be in meters as well. 20 cm is 0,2 meters. The project can also contain multiple types of water. All types of have one thing in common, namely that they all have the WATER attribute, which can be tested against. (In this example, the grid of inundation has the ID 4, and has its result type set to water stress.)

SELECT_LANDSIZE_WHERE_MINGRIDVALUE_IS_0.2_AND_GRID_IS_4_AND_TERRAIN_WITH_ATTRIBUTE_IS_WATER

  • SELECT_LANDSIZE: The end result must be some area; some amount of square meters.
  • MINGRIDVALUE_IS_0.2: We only want to count the area where the value calculated is at least 0.2 (meters).
  • GRID_IS_4: We need to specify the grid we wish to use the values of.
  • TERRAIN_WITH_ATTRIBUTE_IS_WATER: We are only looking for the water which ends up on water, identified by the "WATER" attribute.

Buffers

The amount of green in or near a neighborhood

Green buildings can be found by their green function value. The value is the amount of green in square meters, per square meter of building. Green can be in a neighborhood, but can also be within a certain range near a neighborhood (say, 20 meters) and still have an effective presence.

SELECT_LOTSIZE_WHERE_NEIGHBORHOOD_IS_1_AND_BUFFER_IS_20.0_AND_FUNCTIONMULT_IS_VEGETATION_FRACTION

  • SELECT_LOTSIZE: The end result must be area taken up by buildings; some amount in square meters.
  • NEIGHBORHOOD_IS_1: We want the greenery in a particular neighborhood.
  • BUFFER_IS_20.0: We don't just want to look at buildings in the neighborhood itself, but also buildings within 20 meters of the neighborhood
  • FUNCTIONMULT_IS_VEGETATION_FRACTION:The end result must be multiplied by the green value of the respective buildings found.