Skip to content

Commit

Permalink
Merge pull request #964 from ebocher/fix_960
Browse files Browse the repository at this point in the history
About #960
  • Loading branch information
ebocher authored May 7, 2024
2 parents 4714408 + 9f7b8b5 commit 66d6c6f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,8 @@ Map osm_processing(JdbcDataSource h2gis_datasource, def processing_parameters, d
//Extract and compute population indicators for the specified year
//This data can be used by the grid_indicators process
if (worldpop_indicators) {
def bbox = [zones.envelope.getMinY() as Float, zones.envelope.getMinX() as Float,
zones.envelope.getMaxY() as Float, zones.envelope.getMaxX() as Float]
def bbox = [zones.osm_envelope_extented.getMinY() as Float, zones.osm_envelope_extented.getMinX() as Float,
zones.osm_envelope_extented.getMaxY() as Float, zones.osm_envelope_extented.getMaxX() as Float]
String coverageId = "wpGlobal:ppp_2020"
String worldPopFile = WorldPopTools.Extract.extractWorldPopLayer(coverageId, bbox)
if (worldPopFile) {
Expand Down Expand Up @@ -669,7 +669,7 @@ Map osm_processing(JdbcDataSource h2gis_datasource, def processing_parameters, d
} else {
info "Cannot create a grid to aggregate the indicators"
h2gis_datasource.execute("""INSERT INTO $logTableZones
VALUES(st_geomfromtext('${zones.geometry}',4326) ,'$id_zone', 'Error computing the grid indicators'
VALUES(st_geomfromtext('${zones.osm_geometry}',4326) ,'$id_zone', 'Error computing the grid indicators'
'${Geoindicators.version()}',
'${Geoindicators.buildNumber()}')""".toString())
}
Expand All @@ -689,7 +689,7 @@ Map osm_processing(JdbcDataSource h2gis_datasource, def processing_parameters, d

} else {
h2gis_datasource.execute("""INSERT INTO $logTableZones
VALUES(st_geomfromtext('${zones.geometry}',4326) ,'$id_zone', 'Error loading the OSM file',
VALUES(st_geomfromtext('${zones.osm_geometry}',4326) ,'$id_zone', 'Error loading the OSM file',
'${Geoindicators.version()}',
'${Geoindicators.buildNumber()}')""".toString())
error "Cannot load the OSM file ${extract}"
Expand All @@ -698,7 +698,7 @@ Map osm_processing(JdbcDataSource h2gis_datasource, def processing_parameters, d
} else {
//Log in table
h2gis_datasource.execute("""INSERT INTO $logTableZones
VALUES(st_geomfromtext('${zones.geometry}',4326) ,'$id_zone', 'Error to extract the data with OverPass'
VALUES(st_geomfromtext('${zones.osm_geometry}',4326) ,'$id_zone', 'Error to extract the data with OverPass'
,'${Geoindicators.version()}', '${Geoindicators.buildNumber()}')""".toString())
error "Cannot execute the overpass query $query"
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,11 +649,11 @@ class WorflowOSMTest extends WorkflowAbstractTest {
File dirFile = new File(directory)
dirFile.delete()
dirFile.mkdir()
def location = "Avignon"
def nominatim = org.orbisgis.geoclimate.osmtools.OSMTools.Utilities.getNominatimData(location)
def location = "Redon"
//def nominatim = org.orbisgis.geoclimate.osmtools.OSMTools.Utilities.getNominatimData(location)
def grid_size = 100
location = nominatim.bbox
location=[44.795480,12.323227,45.004622,12.627411]
// location = nominatim.bbox
// location=[44.795480,12.323227,45.004622,12.627411]
def osm_parmeters = [
"description" : "Example of configuration file to run the OSM workflow and store the result in a folder",
"geoclimatedb": [
Expand All @@ -675,26 +675,26 @@ class WorflowOSMTest extends WorkflowAbstractTest {
["distance" : 0,
"rsu_indicators" : [

"indicatorUse": ["LCZ", "UTRF", "TEB"]
"indicatorUse": ["LCZ"] //, "UTRF", "TEB"]

]/*,"grid_indicators": [
],"grid_indicators": [
"x_size": grid_size,
"y_size": grid_size,
//"rowCol": true,
"indicators": ["BUILDING_FRACTION","BUILDING_HEIGHT", "BUILDING_POP",
"BUILDING_TYPE_FRACTION",
"WATER_FRACTION","VEGETATION_FRACTION",
"ROAD_FRACTION", "IMPERVIOUS_FRACTION",
"indicators": [//"BUILDING_FRACTION","BUILDING_HEIGHT", "BUILDING_POP",
//"BUILDING_TYPE_FRACTION",
//"WATER_FRACTION","VEGETATION_FRACTION",
//"ROAD_FRACTION", "IMPERVIOUS_FRACTION",
"LCZ_PRIMARY",
"BUILDING_HEIGHT_WEIGHTED", "BUILDING_SURFACE_DENSITY",
"SEA_LAND_FRACTION",
"ASPECT_RATIO",
//"BUILDING_HEIGHT_WEIGHTED", "BUILDING_SURFACE_DENSITY",
//"SEA_LAND_FRACTION",
//"ASPECT_RATIO",
//"SVF",
"HEIGHT_OF_ROUGHNESS_ELEMENTS", "TERRAIN_ROUGHNESS_CLASS",
// "HEIGHT_OF_ROUGHNESS_ELEMENTS", "TERRAIN_ROUGHNESS_CLASS",
"SPRAWL_AREAS",
"SPRAWL_DISTANCES", "SPRAWL_COOL_DISTANCE"],
//"lcz_lod":2
]*/ /*, "worldpop_indicators": true,
], "worldpop_indicators": true/*
"road_traffic" : true,
"noise_indicators" : [
Expand Down

0 comments on commit 66d6c6f

Please sign in to comment.