Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the building height indicator #1012

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading