Skip to content

Commit

Permalink
Start adding indicators in the chain
Browse files Browse the repository at this point in the history
  • Loading branch information
j3r3m1 committed Mar 28, 2024
1 parent a0d1bf9 commit 90a3ef9
Showing 1 changed file with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,25 @@ String computeRSUIndicators(JdbcDataSource datasource, String buildingTable,
finalTablesToJoin.put(computeGeometryProperties, columnIdRsu)
}

// Calculate building height distribution
String buildingCutted
if (indicatorUse*.toUpperCase().contains("TEB")) {
if (!buildingCutted) {
buildingCutted = cutBuilding(datasource, rsu, buildingTable)
if (!buildingCutted) {
info "Cannot split the building with the grid to compute the building height distribution"
return
}
}
def roofFractionDistributionExact = Geoindicators.RsuIndicators.roofFractionDistributionExact(datasource,
rsu, buildingCutted, columnIdRsu,
[0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50], false, prefixName)
if (roofFractionDistributionExact) {
finalTablesToJoin.put(roofFractionDistributionExact, columnIdRsu)
} else {
info "Cannot compute the roof fraction distribution."
}
}

// Building free external facade density
if (indicatorUse*.toUpperCase().contains("UTRF") || indicatorUse*.toUpperCase().contains("LCZ")) {
Expand All @@ -564,7 +583,7 @@ String computeRSUIndicators(JdbcDataSource datasource, String buildingTable,
def inputVarAndOperations = [:]
def heightColumnName = parameters.heightColumnName

if (indicatorUse*.toUpperCase().contains("LCZ") || indicatorUse*.toUpperCase().contains("TEB")) {
if (indicatorUse*.toUpperCase().contains("LCZ")) {
inputVarAndOperations = inputVarAndOperations << [(heightColumnName): ["GEOM_AVG"]]
}
if (indicatorUse*.toUpperCase().contains("UTRF")) {
Expand All @@ -576,12 +595,14 @@ String computeRSUIndicators(JdbcDataSource datasource, String buildingTable,
"building" : ["NB_DENS"],
"pop" : ["SUM", "DENS"]]
}
if (indicatorUse*.toUpperCase().contains("TEB")) {
inputVarAndOperations = inputVarAndOperations << [(heightColumnName): ["GEOM_AVG", "AVG", "STD"]]
}
def rsuStatisticsUnweighted = Geoindicators.GenericIndicators.unweightedOperationFromLowerScale(datasource, buildingTable,
rsu, columnIdRsu, columnIdBuild,
inputVarAndOperations, temporaryPrefName)
if (!rsuStatisticsUnweighted) {
info "Cannot compute the statistics : building, building volume densities, building number density" +
" and mean building neighbor number for the RSU"
info "Cannot compute the building unweighted statistics at RSU scale"
return
}
// Join in an intermediate table (for perviousness fraction)
Expand Down Expand Up @@ -1897,7 +1918,7 @@ String rasterizeIndicators(JdbcDataSource datasource,
if (!buildingCutted) {
buildingCutted = cutBuilding(datasource, grid, building)
if (!buildingCutted) {
info "Cannot split the building with the grid to compute the building height distance"
info "Cannot split the building with the grid to compute the building height distribution"
return
}
}
Expand Down

0 comments on commit 90a3ef9

Please sign in to comment.