Skip to content

Commit

Permalink
Add TERRAIN_ROUGHNESS_CLASS at grid scale
Browse files Browse the repository at this point in the history
  • Loading branch information
ebocher committed Oct 3, 2023
1 parent edccc54 commit 5a8a257
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,8 @@ abstract class AbstractBDTopoWorkflow extends BDTopoUtils {
def allowed_grid_indicators = ["BUILDING_FRACTION", "BUILDING_HEIGHT", "BUILDING_POP", "BUILDING_TYPE_FRACTION", "WATER_FRACTION", "VEGETATION_FRACTION",
"ROAD_FRACTION", "IMPERVIOUS_FRACTION", "UTRF_AREA_FRACTION", "UTRF_FLOOR_AREA_FRACTION", "LCZ_FRACTION", "LCZ_PRIMARY", "FREE_EXTERNAL_FACADE_DENSITY",
"BUILDING_HEIGHT_WEIGHTED", "BUILDING_SURFACE_DENSITY",
"BUILDING_HEIGHT_DIST", "FRONTAL_AREA_INDEX", "SEA_LAND_FRACTION", "ASPECT_RATIO", "SVF", "HEIGHT_OF_ROUGHNESS_ELEMENTS"]
"BUILDING_HEIGHT_DIST", "FRONTAL_AREA_INDEX", "SEA_LAND_FRACTION", "ASPECT_RATIO",
"SVF", "HEIGHT_OF_ROUGHNESS_ELEMENTS", "TERRAIN_ROUGHNESS_CLASS"]
def allowedOutputIndicators = allowed_grid_indicators.intersect(list_indicators*.toUpperCase())
if (allowedOutputIndicators) {
//Update the RSU indicators list according the grid indicators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,7 @@ String linearRoadOperations(JdbcDataSource datasource, String rsuTable, String r
* @param datasource A connexion to a database (H2GIS, PostGIS, ...) where are stored the input Table and in which
* the resulting database will be stored
* @param rsuTable the name of the input ITable where are stored the effectiveTerrainRoughnessHeight values
* @param id_rsu Unique identifier column name
* @param effectiveTerrainRoughnessLength the field name corresponding to the RSU effective terrain roughness class due
* to roughness elements (buildings, trees, etc.) (in the rsuTable)
* @param prefixName String use as prefix to name the output table
Expand All @@ -1102,8 +1103,7 @@ String linearRoadOperations(JdbcDataSource datasource, String rsuTable, String r
*
* @author Jérémy Bernard
*/
String effectiveTerrainRoughnessClass(JdbcDataSource datasource, String rsu, String effectiveTerrainRoughnessLength, String prefixName) {
def ID_COLUMN_RSU = "id_rsu"
String effectiveTerrainRoughnessClass(JdbcDataSource datasource, String rsu, String id_rsu, String effectiveTerrainRoughnessLength, String prefixName) {
def BASE_NAME = "effective_terrain_roughness_class"

debug "Executing RSU effective terrain roughness class"
Expand All @@ -1113,7 +1113,7 @@ String effectiveTerrainRoughnessClass(JdbcDataSource datasource, String rsu, Str

// Based on the lookup Table of Davenport
datasource """DROP TABLE IF EXISTS $outputTableName;
CREATE TABLE $outputTableName AS SELECT $ID_COLUMN_RSU,
CREATE TABLE $outputTableName AS SELECT $id_rsu,
CASEWHEN($effectiveTerrainRoughnessLength<0.0 OR $effectiveTerrainRoughnessLength IS NULL, null,
CASEWHEN($effectiveTerrainRoughnessLength<0.00035, 1,
CASEWHEN($effectiveTerrainRoughnessLength<0.01525, 2,
Expand Down
Loading

0 comments on commit 5a8a257

Please sign in to comment.