TQL Examples
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_5To query whether each Neighborhood is active, returning an array of 0 and 1's:
SELECT_ACTIVE_WHERE_NEIGHBORHOOD_IS_XTo query whether an Indicator with Item ID 8 is active, returning 1 if active, 0 otherwise:
SELECT_ACTIVE_WHERE_INDICATOR_IS_8To query whether an Scenario with Item ID 0 is active, returning 1 if active, 0 otherwise:
SELECT_ACTIVE_WHERE_SCENARIO_IS_0To query whether a test-run or single/multi stakeholder session is active, returning 1 if active, 0 otherwise:
SELECT_ACTIVE_WHERE_SCENARIO_IS_ACTIVETo query whether a Heat Network is active, returning 1 if active, 0 otherwise:
SELECT_ACTIVE_WHERE_NET_TYPE_IS_HEATTo query whether an Overlay with Item ID 25 is active, returning 1 if active, 0 otherwise:
SELECT_ACTIVE_WHERE_OVERLAY_IS_25To query whether an Area with Item ID 4 is active, returning 1 if active, 0 otherwise:
SELECT_ACTIVE_WHERE_AREA_IS_4To query whether Areas with the Attribute DESTINATION are active, returning an array of 0 and 1's:
SELECT_ACTIVE_WHERE_AREA_IS_XA_DESTINATIONSelect 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_INHABITANTSTo 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_M2To 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_POWERIn 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_TIMEFRAMESTo 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_1To 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_XAttribute 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_OUTPUTTo 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_XWeirs 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_IDColor
- 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_5To query the color of a Stakeholder with Item ID 3, returning the color in HEX Format:
SELECT_COLOR_WHERE_STAKEHOLDER_IS_3To query the default color of a Stakeholder Type MUNICIPALITY, returning the color in HEX Format:
SELECT_COLOR_WHERE_STAKEHOLDERTYPE_IS_MUNICIPALITYDistance
- 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_5To 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_XExpenses
- 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_3Floorsize
- 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_4To 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_CORPORATIONTo 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_YTo 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_MONUMENTALTo 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_665To 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_XTo 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_TRUEAdvanced 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_BUILDINGGlobal
- 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_CONSTANTTo 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_3To 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_XGrid 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_3To 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_XTo 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_3Grid 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_10To 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_XTo 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_MEASUREMENTGrid 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_12To 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_XTo 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_MEASUREMENTGrid 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_XTo 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_LEVELTo 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_XGrid 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_1770To 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_5To 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_YTo 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_YID
- Main article: Select id (TQL)
To query the Item ID of a Neighborhood, returned as an Integer:
SELECT_ID_WHERE_NEIGHBORHOOD_IS_2To 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_INTERESTTo query the Item ID of the Active Scenario, returned as an Integer:
SELECT_ID_WHERE_SCENARIO_IS_ACTIVETo 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_STAKEHOLDERTo query the Item IDs of each Measure in a project, returned as an array of Integers:
SELECT_ID_WHERE_MEASURE_IS_XTo 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_BUILDINGTo 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_PARENTTo 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_RAINFALLIteration
- Main article: Select iteration (TQL)
To query the currently active iteration of the performed calculation, returning an integer:
SELECT_ITERATION_WHEREIterations
- Main article: Select iterations (TQL)
To query the total amount of iterations set for your project, returning an integer:
SELECT_ITERATIONS_WHERELand 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_WATERTo query the land size per water terrain, returned as an array of decimal numbers:
SELECT_LANDSIZE_WHERE_TERRAIN_IS_XA_WATERTo 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_LEVELConsider 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_0Latitude
- 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_0To 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_4326To 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_3857Length
- 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_3To query the total length of Net Lines of Net Type Gas, returning a decimal number:
SELECT_LENGTH_WHERE_NET_TYPE_IS_GASTo query the length of a Net Line with ID 5, returning a decimal number:
SELECT_LENGTH_WHERE_NET_LINE_IS_5To query the length of each Net Line with attribute COATED, returning an array of decimal number:
SELECT_LENGTH_WHERE_NET_LINE_IS_XA_COATEDLevees
- 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_3To 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_XLongitude
- 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_0To 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_4326To 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_3857Lotpolygons
- 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_4To 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_XOR
SELECT_LOTSIZE_WHERE_FUNCTIONMULT_IS_SOLID_AND_NEIGHBORHOOD_IS_XTo 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_M2Lotsize 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_M2To 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_M2OR
SELECT_LOTSIZE_WHERE_ATTRIBUTEMULT_IS_PAVED_AREA_PARKING_LOTS_PER_M2_AND_FUNCTION_IS_XA_PAVED_AREA_PARKING_LOTS_PER_M2Name
- Main article: Select name (TQL)
To query the name of the SOCIAL Category, returned as a String object:
SELECT_NAME_WHERE_CATEGORY_IS_SOCIALTo query the name of a Neighborhood with the Item ID 2, returned as a String object:
SELECT_NAME_WHERE_NEIGHBORHOOD_IS_2To query the name of each Neighborhood, returned as an array of String objects:
SELECT_NAME_WHERE_NEIGHBHORHOOD_IS_XTo query the name of each Neighborhood that has the attribute INHABITANTS, returned as an array of String objects:
SELECT_NAME_WHERE_NEIGHBHORHOOD_IS_XA_INHABITANTSTo 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_INTERESTTo query the name of the Active Scenario, returned as a String object:
SELECT_NAME_WHERE_SCENARIO_IS_ACTIVETo 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_STAKEHOLDERTo query the name of each Measure in a project, returned as an array of String objects:
SELECT_NAME_WHERE_MEASURE_IS_XTo 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_BUILDINGTo 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_PARENTTo 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_RAINFALLNet 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_ELECTRICITYTo 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_XTo 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_XRevenue
- 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_4Score
- 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_2To 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_YTo query the score of Indicators with the attribute HOUSING, returned as an array of decimal numbers:
SELECT_SCORE_WHERE_INDICATOR_IS_XA_HOUSINGSession State
- Main article: Select sessionstate (TQL)
The query the current state of a session, returned as an Integer representing the sessionstate:
SELECT_SESSIONSTATE_WHEREState
- 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_3To query the state of each Measure in a project, returned as an array of Strings:
SELECT_STATE_WHERE_MEASURE_IS_XTarget
- 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_4To query the target of each Indicator, returning an array of decimal numbers:
SELECT_TARGET_WHERE_INDICATOR_IS_XTo query the target of each Indicator with the attribute ENVIRONMENTAL, returning an array of decimal numbers:
SELECT_TARGET_WHERE_INDICATOR_IS_XA_ENVIRONMENTALToken
- 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_4To query the Municipality Stakeholder's Web token to interact with the Web endpoints, returning the token as a String:
SELECT_TOKEN_WHERE_STAKEHOLDERTYPE_IS_MUNICIPALITYTopfloor
- 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_2671To 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_WEIGHTUnits
- 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_1669To query the amount of Affordable Housing units per neighborhood, returning an array of decimal numbers:
SELECT_UNITS_WHERE_CATEGORY_IS_SOCIAL_AND_NEIGHBORHOOD_IS_XTo 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.0To 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_2To 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_PANELTo 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_MONUMENTALTo 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_MONUMENTALTo 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_4To 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_CONSTRUCTIONTo 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_TRUEUnits 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.001To 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_HEATTo 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_10Other
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 neighborhoodFUNCTIONMULT_IS_VEGETATION_FRACTION:The end result must be multiplied by the green value of the respective buildings found.
See also