From 9f7b8b5de757555837762c0b49853873d60bdc9b Mon Sep 17 00:00:00 2001 From: ebocher Date: Tue, 7 May 2024 16:03:20 +0200 Subject: [PATCH] Fix stupid bug due to some changes in the names of zone map --- .../geoclimate/osm/WorkflowOSM.groovy | 10 +++---- .../geoclimate/osm/WorflowOSMTest.groovy | 30 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) 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 3fad0e0b89..0b0cf1c200 100644 --- a/osm/src/main/groovy/org/orbisgis/geoclimate/osm/WorkflowOSM.groovy +++ b/osm/src/main/groovy/org/orbisgis/geoclimate/osm/WorkflowOSM.groovy @@ -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) { @@ -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()) } @@ -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}" @@ -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 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 d7349716fc..06c6d8ffe8 100644 --- a/osm/src/test/groovy/org/orbisgis/geoclimate/osm/WorflowOSMTest.groovy +++ b/osm/src/test/groovy/org/orbisgis/geoclimate/osm/WorflowOSMTest.groovy @@ -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": [ @@ -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" : [