Skip to content

Commit

Permalink
Merge pull request #1012 from ebocher/FIX_TARGET
Browse files Browse the repository at this point in the history
Replace the building height indicator
  • Loading branch information
ebocher authored Nov 25, 2024
2 parents e580983 + f2b22fb commit cf4752d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ abstract class AbstractBDTopoWorkflow extends BDTopoUtils {
"output" : "fgb",
"rowCol" : false,
"indicators": ["BUILDING_FRACTION",
"BUILDING_HEIGHT",
"BUILDING_HEIGHT_WEIGHTED",
"WATER_FRACTION",
"ROAD_FRACTION",
"IMPERVIOUS_FRACTION",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ String formatGrid4Target(JdbcDataSource datasource, String gridTable) {
DROP TABLE IF EXISTS ${grid_target};
CREATE TABLE ${grid_target} as SELECT
THE_GEOM,
ID_COL, ID_ROW,
CAST(row_number() over(ORDER BY ID_ROW DESC) as integer) as "FID",
BUILDING_FRACTION AS "roof",
ROAD_FRACTION AS "road",
Expand All @@ -397,15 +398,15 @@ String formatGrid4Target(JdbcDataSource datasource, String gridTable) {
ELSE
LOW_VEGETATION_FRACTION END AS "dry",
0 AS "irr",
AVG_HEIGHT_ROOF AS "H",
AVG_HEIGHT_ROOF_AREA_WEIGHTED AS "H",
CASE WHEN
STREET_WIDTH IS NULL THEN 0.1 ELSE STREET_WIDTH END AS "W"
FROM ${gridTable}
""")
return grid_target
}catch (SQLException e){
//We create an empty table
datasource.execute("""CREATE TABLE $grid_target (FID INT, THE_GEOM GEOMETRY,
datasource.execute("""CREATE TABLE $grid_target (FID INT, ID_COL INT, ID_ROW INT, THE_GEOM GEOMETRY,
"roof" VARCHAR, "road" VARCHAR, "watr" VARCHAR, "conc" VARCHAR,
"Veg" VARCHAR, "dry" VARCHAR, "irr" VARCHAR , "H" VARCHAR, "W" VARCHAR)""")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,7 @@ String rasterizeIndicators(JdbcDataSource datasource,

def unweightedBuildingIndicators = [:]
def weightedBuildingIndicators = [:]
def height_roof_unweighted_list = []
HashSet height_roof_unweighted_list = new HashSet()
list_indicators_upper.each {
if (it == "BUILDING_FRACTION"
|| it == "BUILDING_SURFACE_DENSITY" ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ def extractProcessingParameters(def processing_parameters) throws Exception {
//Update the GRID indicators list if TARGET output is specified
if(target_grid_indicators){
allowedOutputIndicators.addAll(["BUILDING_FRACTION",
"BUILDING_HEIGHT",
"BUILDING_HEIGHT_WEIGHTED",
"WATER_FRACTION",
"ROAD_FRACTION",
"IMPERVIOUS_FRACTION",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ class WorflowOSMTest extends WorkflowAbstractTest {
def nominatim = OSMTools.Utilities.getNominatimData(location)
def grid_size = 100
location =[47.214976592711274,-1.6425595375815742,47.25814872718718,-1.5659501122281323]
//location=[47.215334,-1.558058,47.216646,-1.556185]
//location = nominatim.bbox
//location=[51.2, 1.0, 51.4, 1.2]
/* location =[ 48.84017284026897,
Expand Down Expand Up @@ -758,14 +759,14 @@ class WorflowOSMTest extends WorkflowAbstractTest {
"parameters" :
["distance" : 0,
"rsu_indicators" : [
"indicatorUse": ["LCZ", "TEB"] //, "UTRF"]
"indicatorUse": ["LCZ", "TEB", "TARGET"] //, "UTRF"]

], "grid_indicators" : [
"x_size" : grid_size,
"y_size" : grid_size,
"indicators": [
"BUILDING_FRACTION",
"BUILDING_HEIGHT",
"BUILDING_HEIGHT_WEIGHTED",
//"BUILDING_POP",
//"BUILDING_TYPE_FRACTION",
"WATER_FRACTION",
Expand Down

0 comments on commit cf4752d

Please sign in to comment.