diff --git a/bdtopo/src/main/groovy/org/orbisgis/geoclimate/bdtopo/AbstractBDTopoWorkflow.groovy b/bdtopo/src/main/groovy/org/orbisgis/geoclimate/bdtopo/AbstractBDTopoWorkflow.groovy index b4e3120d19..05e9e04424 100644 --- a/bdtopo/src/main/groovy/org/orbisgis/geoclimate/bdtopo/AbstractBDTopoWorkflow.groovy +++ b/bdtopo/src/main/groovy/org/orbisgis/geoclimate/bdtopo/AbstractBDTopoWorkflow.groovy @@ -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", diff --git a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/GridIndicators.groovy b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/GridIndicators.groovy index 42ed32dedf..655fae5dcd 100644 --- a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/GridIndicators.groovy +++ b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/GridIndicators.groovy @@ -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", @@ -397,7 +398,7 @@ 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} @@ -405,7 +406,7 @@ String formatGrid4Target(JdbcDataSource datasource, String 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)""") } diff --git a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy index d5483ff3f4..e176e1fac2 100644 --- a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy +++ b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy @@ -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" || diff --git a/osm/src/main/groovy/org/orbisgis/geoclimate/osm/WorkflowOSM.groovy b/osm/src/main/groovy/org/orbisgis/geoclimate/osm/WorkflowOSM.groovy index 78b999e93e..4253ae5282 100644 --- a/osm/src/main/groovy/org/orbisgis/geoclimate/osm/WorkflowOSM.groovy +++ b/osm/src/main/groovy/org/orbisgis/geoclimate/osm/WorkflowOSM.groovy @@ -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", diff --git a/osm/src/test/groovy/org/orbisgis/geoclimate/osm/WorflowOSMTest.groovy b/osm/src/test/groovy/org/orbisgis/geoclimate/osm/WorflowOSMTest.groovy index 242240c23b..fee294d8f7 100644 --- a/osm/src/test/groovy/org/orbisgis/geoclimate/osm/WorflowOSMTest.groovy +++ b/osm/src/test/groovy/org/orbisgis/geoclimate/osm/WorflowOSMTest.groovy @@ -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, @@ -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",