Skip to content

Commit

Permalink
Fix urban_cool_areas in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ebocher committed Jun 10, 2024
1 parent 4302be1 commit 1e61e2a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,10 @@ abstract class AbstractBDTopoWorkflow extends BDTopoUtils {
Map sprawl_indic = Geoindicators.WorkflowGeoIndicators.sprawlIndicators(h2gis_datasource, rasterizedIndicators, "id_grid", grid_indicators_params.indicators,
Math.max(x_size, y_size).floatValue())
if (sprawl_indic) {
results.put("sprawl_areas", sprawl_indic.sprawl_areas)
results.put("urban_sprawl_areas", sprawl_indic.urban_sprawl_areas)
if (sprawl_indic.urban_cool_areas) {
results.put("urban_cool_areas", sprawl_indic.urban_cool_areas)
}
results.put("grid_indicators", sprawl_indic.grid_indicators)
}
info("End computing grid_indicators")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2207,11 +2207,10 @@ Map sprawlIndicators(JdbcDataSource datasource, String grid_indicators, String i
}
}
}

if (list_indicators_upper.contains("URBAN_SPRAWL_COOL_DISTANCE")) {
cool_areas = Geoindicators.SpatialUnits.extractCoolAreas(datasource, grid_indicators, (distance / 2) as float)
cool_areas = Geoindicators.SpatialUnits.extractCoolAreas(datasource, grid_indicators, sprawl_areas, (distance / 2) as float)
if (cool_areas) {
String inverse_cool_areas = Geoindicators.SpatialUnits.inversePolygonsLayer(datasource, cool_areas, sprawl_areas)
String inverse_cool_areas = Geoindicators.SpatialUnits.inversePolygonsLayer(datasource, sprawl_areas,cool_areas)
if (inverse_cool_areas) {
tablesToDrop << inverse_cool_areas
String cool_distances = Geoindicators.GridIndicators.gridDistances(datasource, inverse_cool_areas, grid_indicators, id_grid, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ def saveOutputFiles(def h2gis_datasource, def id_zone, def results, def outputFi
} else {
FileUtilities.deleteFiles(subFolder)
}
outputFiles.each {
outputFiles.each { it->
if (it == "grid_indicators") {
if (outputGrid == "fgb") {
Geoindicators.WorkflowUtilities.saveInFile(results."$it", "${subFolder.getAbsolutePath() + File.separator + it}.fgb", h2gis_datasource, outputSRID, reproject, deleteOutputData)
Expand Down

0 comments on commit 1e61e2a

Please sign in to comment.