From f4fa4ff27e730cd44987940ee489ed30c529dac7 Mon Sep 17 00:00:00 2001 From: ebocher Date: Fri, 2 Feb 2024 15:44:59 +0100 Subject: [PATCH 1/5] Remove logback --- common-utils/pom.xml | 6 +++--- .../orbisgis/geoclimate/utils/LoggerUtils.groovy | 13 ++++--------- .../orbisgis/geoclimate/osmtools/OSMTools.groovy | 2 -- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/common-utils/pom.xml b/common-utils/pom.xml index 0805acc9df..3927c5828a 100644 --- a/common-utils/pom.xml +++ b/common-utils/pom.xml @@ -30,9 +30,9 @@ slf4j-api - ch.qos.logback - logback-classic - ${logback-version} + org.slf4j + slf4j-simple + ${slf4j-version} diff --git a/common-utils/src/main/groovy/org/orbisgis/geoclimate/utils/LoggerUtils.groovy b/common-utils/src/main/groovy/org/orbisgis/geoclimate/utils/LoggerUtils.groovy index aeb14a1bb3..167346048b 100644 --- a/common-utils/src/main/groovy/org/orbisgis/geoclimate/utils/LoggerUtils.groovy +++ b/common-utils/src/main/groovy/org/orbisgis/geoclimate/utils/LoggerUtils.groovy @@ -1,7 +1,5 @@ package org.orbisgis.geoclimate.utils -import ch.qos.logback.classic.Level -import ch.qos.logback.classic.LoggerContext import org.slf4j.Logger import org.slf4j.LoggerFactory @@ -77,20 +75,17 @@ class LoggerUtils { */ static void setLoggerLevel(String loggerLevel) { if (loggerLevel) { - Level level if (loggerLevel.equalsIgnoreCase("INFO")) { - level = Level.INFO + System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", loggerLevel.toLowerCase()) } else if (loggerLevel.equalsIgnoreCase("DEBUG")) { - level = Level.DEBUG + System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", loggerLevel.toLowerCase()) } else if (loggerLevel.equalsIgnoreCase("TRACE")) { - level = Level.TRACE + System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", loggerLevel.toLowerCase()) } else if (loggerLevel.equalsIgnoreCase("OFF")) { - level = Level.OFF + System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", loggerLevel.toLowerCase()) } else { throw new RuntimeException("Invalid log level. Allowed values are : INFO, DEBUG, TRACE, OFF") } - var context = (LoggerContext) LoggerFactory.getILoggerFactory() - context.getLoggerList().each { it -> it.setLevel(level) } } } diff --git a/osmtools/src/main/groovy/org/orbisgis/geoclimate/osmtools/OSMTools.groovy b/osmtools/src/main/groovy/org/orbisgis/geoclimate/osmtools/OSMTools.groovy index d9329ef1f5..d29497d1be 100644 --- a/osmtools/src/main/groovy/org/orbisgis/geoclimate/osmtools/OSMTools.groovy +++ b/osmtools/src/main/groovy/org/orbisgis/geoclimate/osmtools/OSMTools.groovy @@ -23,8 +23,6 @@ package org.orbisgis.geoclimate.osmtools import org.orbisgis.geoclimate.osmtools.utils.TransformUtils import org.orbisgis.geoclimate.osmtools.utils.Utilities import org.orbisgis.geoclimate.utils.AbstractScript -import org.slf4j.Logger -import org.slf4j.LoggerFactory /** * Main script to access to all processes used to extract, transform and save OSM data as GIS layers. From a5ff11650eab8914cfde01419a52fe350008f3e7 Mon Sep 17 00:00:00 2001 From: ebocher Date: Tue, 6 Feb 2024 16:47:20 +0100 Subject: [PATCH 2/5] Fix #933 --- .../bdtopo/AbstractBDTopoWorkflow.groovy | 2 +- .../bdtopo/WorkflowDebugTest.groovy | 21 ++++++++++++------- .../geoindicators/GenericIndicators.groovy | 4 ++-- .../WorkflowGeoIndicators.groovy | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/bdtopo/src/main/groovy/org/orbisgis/geoclimate/bdtopo/AbstractBDTopoWorkflow.groovy b/bdtopo/src/main/groovy/org/orbisgis/geoclimate/bdtopo/AbstractBDTopoWorkflow.groovy index 816ca83561..73b03945d0 100644 --- a/bdtopo/src/main/groovy/org/orbisgis/geoclimate/bdtopo/AbstractBDTopoWorkflow.groovy +++ b/bdtopo/src/main/groovy/org/orbisgis/geoclimate/bdtopo/AbstractBDTopoWorkflow.groovy @@ -915,7 +915,7 @@ abstract class AbstractBDTopoWorkflow extends BDTopoUtils { def urban_areas = dataFormated.urban_areas - info "BDTOPO V2 GIS layers formated" + info "BDTOPO GIS layers formated" def rsu_indicators_params = processing_parameters.rsu_indicators def worldpop_indicators = processing_parameters.worldpop_indicators diff --git a/bdtopo/src/test/groovy/org/orbisgis/geoclimate/bdtopo/WorkflowDebugTest.groovy b/bdtopo/src/test/groovy/org/orbisgis/geoclimate/bdtopo/WorkflowDebugTest.groovy index c692c1453f..34ee81e685 100644 --- a/bdtopo/src/test/groovy/org/orbisgis/geoclimate/bdtopo/WorkflowDebugTest.groovy +++ b/bdtopo/src/test/groovy/org/orbisgis/geoclimate/bdtopo/WorkflowDebugTest.groovy @@ -137,7 +137,7 @@ class WorkflowDebugTest { @Test void testIntegrationFolderInput() { def input_data = "/media/ebocher/Extreme SSD/bdtopo/bdtopo2/BDTOPO_2-2_TOUSTHEMES_SHP_LAMB93_D035_2018-09-25/BDTOPO/1_DONNEES_LIVRAISON_2018-11-00144/BDT_2-2_SHP_LAMB93_D035-ED182" - def locations = ["Gimont"] + def locations = [ "Redon"] String directory = "/tmp/bdtopo2" File dirFile = new File(directory) dirFile.delete() @@ -158,20 +158,27 @@ class WorkflowDebugTest { "parameters" : ["distance" : 0, rsu_indicators : [ - "indicatorUse": ["LCZ"]//, "UTRF"] + "indicatorUse": ["LCZ", "UTRF", "URBAN_TYPOLOGY"] ], - /*"grid_indicators": [ + "grid_indicators": [ "x_size" : 1000, "y_size" : 1000, - "indicators": ["LCZ_FRACTION"] - ]*/ + "indicators" :["BUILDING_FRACTION", "BUILDING_HEIGHT", "BUILDING_POP", + "BUILDING_TYPE_FRACTION", "WATER_FRACTION", "VEGETATION_FRACTION", + "ROAD_FRACTION", "IMPERVIOUS_FRACTION", "FREE_EXTERNAL_FACADE_DENSITY", + "BUILDING_HEIGHT_WEIGHTED", "BUILDING_SURFACE_DENSITY", + "SEA_LAND_FRACTION", "ASPECT_RATIO", "SVF", + "HEIGHT_OF_ROUGHNESS_ELEMENTS", "TERRAIN_ROUGHNESS_CLASS", + "UTRF_AREA_FRACTION", "UTRF_FLOOR_AREA_FRACTION", + "LCZ_PRIMARY"] + ] ] ] //BDTopo.v2(bdTopoParameters) - input_data = "/home/ebocher/Téléchargements/BDTOPO_3-3_TOUSTHEMES_SHP_LAMB93_D032_2023-09-15/BDTOPO" + input_data = "/media/ebocher/Extreme SSD/bdtopo/bdtopo3/BDTOPO_3-0_TOUSTHEMES_SHP_LAMB93_D035_2022-09-15/BDTOPO" - directory = "/tmp/bdtopo3/result" + directory = "/tmp/bdtopo3" dirFile = new File(directory) dirFile.delete() dirFile.mkdir() diff --git a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/GenericIndicators.groovy b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/GenericIndicators.groovy index 21b9025751..2bc991c0fd 100644 --- a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/GenericIndicators.groovy +++ b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/GenericIndicators.groovy @@ -967,8 +967,8 @@ String upperScaleAreaStatistics(JdbcDataSource datasource, String upperTableName DROP TABLE IF EXISTS $spatialJoinTable; CREATE TABLE $spatialJoinTable AS SELECT b.$upperColumnId, a.$lowerColumnName, - ST_AREA(ST_INTERSECTION(st_force2d(st_makevalid(a.$lowerGeometryColumn)), - st_force2d(st_makevalid(b.$upperGeometryColumn)))) AS area + ST_AREA(ST_INTERSECTION(a.$lowerGeometryColumn, + b.$upperGeometryColumn)) AS area FROM $lowerTableName a, $upperTableName b WHERE a.$lowerGeometryColumn && b.$upperGeometryColumn AND ST_INTERSECTS(st_force2d(a.$lowerGeometryColumn), st_force2d(b.$upperGeometryColumn)); diff --git a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy index 28a58c5106..37c00943b2 100644 --- a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy +++ b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy @@ -2098,7 +2098,7 @@ String cutBuilding(JdbcDataSource datasource, String grid, String building) { DROP TABLE IF EXISTS $buildingCutted; CREATE TABLE $buildingCutted as SELECT *, ST_AREA(THE_GEOM) AS area from - (SELECT a.* EXCEPT(the_geom), st_intersection(a.the_geom, b.the_geom) as the_geom, b.* EXCEPT(the_geom), + (SELECT a.* EXCEPT(the_geom), ST_CollectionExtract(st_intersection(a.the_geom, b.the_geom), 3) as the_geom, b.* EXCEPT(the_geom), (b.HEIGHT_WALL + b.HEIGHT_ROOF) / 2 AS BUILD_HEIGHT FROM $grid as a, $building as b where a.the_geom && b.the_geom and st_intersects(a.the_geom, b.the_geom)) as foo From 9010888ca01f16ff5e809d9af0de4b6731023966 Mon Sep 17 00:00:00 2001 From: Sylvain Palominos Date: Fri, 23 Feb 2024 10:50:04 +0100 Subject: [PATCH 3/5] Fix root pom. --- pom.xml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/pom.xml b/pom.xml index cb5c8c65c0..a2e79d8ff1 100644 --- a/pom.xml +++ b/pom.xml @@ -71,6 +71,7 @@ 3.0.0-M4 3.2.0 3.9.1 + 3.3.0 3.0.0-M5 3.0.0-M5 2.8.1 @@ -255,15 +256,35 @@ ${gmaven-version} ${maven.compiler.target} + PROJECT_AND_PLUGIN + compile + compile + addSources + addTestSources + addStubSources + generateStubs compile + generateTestStubs compileTests + groovydoc + groovydoc-jar + removeStubs + removeTestStubs + + + org.apache.groovy + groovy-all + 4.0.17 + pom + + @@ -409,6 +430,35 @@ org.apache.maven.plugins maven-jar-plugin ${maven-jar-version} + + + default-jar + package + + jar + + + + javadoc-jar + package + + jar + + + javadoc + + + + sources-jar + package + + jar + + + sources + + + @@ -444,6 +494,8 @@ attach-sources verify + aggregate + jar jar-no-fork From dfe5a3c701c2e1cdda59f21334eb4750f7c70580 Mon Sep 17 00:00:00 2001 From: ebocher Date: Fri, 23 Feb 2024 13:16:13 +0100 Subject: [PATCH 4/5] Fix an error with grid indicators when the sea/land mask doesn't contain any sea/land geometries --- .../WorkflowGeoIndicators.groovy | 80 +++++++++++-------- 1 file changed, 46 insertions(+), 34 deletions(-) diff --git a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy index 37c00943b2..de05a252fc 100644 --- a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy +++ b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy @@ -1027,7 +1027,7 @@ Map computeTypologyIndicators(JdbcDataSource datasource, String building_indicat */ Map createUnitsOfAnalysis(JdbcDataSource datasource, String zone, String building, String road, String rail, String vegetation, - String water, String sea_land_mask, String urban_areas, + String water, String sea_land_mask, String urban_areas, String rsu, double surface_vegetation, double surface_hydro, double surface_urban_areas, double snappingTolerance, List indicatorUse = ["LCZ", "UTRF", "TEB"], String prefixName = "") { @@ -1039,7 +1039,7 @@ Map createUnitsOfAnalysis(JdbcDataSource datasource, String zone, String buildin rsu = Geoindicators.SpatialUnits.createTSU(datasource, zone, road, rail, vegetation, water, sea_land_mask, urban_areas, surface_vegetation, - surface_hydro,surface_urban_areas, prefixName) + surface_hydro, surface_urban_areas, prefixName) if (!rsu) { info "Cannot compute the RSU." return @@ -1112,7 +1112,7 @@ Map createUnitsOfAnalysis(JdbcDataSource datasource, String zone, String buildin */ Map getParameters() { return [ - "surface_vegetation" : 10000d, "surface_hydro": 2500d, "surface_urban_areas":10000d, + "surface_vegetation" : 10000d, "surface_hydro": 2500d, "surface_urban_areas": 10000d, "snappingTolerance" : 0.01d, "indicatorUse": ["LCZ", "UTRF", "TEB"], "mapOfWeights" : ["sky_view_factor" : 1, "aspect_ratio": 1, "building_surface_fraction": 1, "impervious_surface_fraction" : 1, "pervious_surface_fraction": 1, @@ -1210,7 +1210,7 @@ Map getParameters(Map parameters) { */ Map computeAllGeoIndicators(JdbcDataSource datasource, String zone, String building, String road, String rail, String vegetation, String water, String impervious, String buildingEstimateTableName, - String sea_land_mask,String urban_areas, String rsuTable, + String sea_land_mask, String urban_areas, String rsuTable, Map parameters = [:], String prefixName) { Map inputParameters = getParameters() if (parameters) { @@ -1241,7 +1241,7 @@ Map computeAllGeoIndicators(JdbcDataSource datasource, String zone, String build water, impervious, buildingEstimateTableName, sea_land_mask, urban_areas, rsuTable, - surface_vegetation, surface_hydro,surface_urban_areas, + surface_vegetation, surface_hydro, surface_urban_areas, snappingTolerance, buildingHeightModelName, prefixName) if (!estimHeight) { @@ -1330,9 +1330,9 @@ Map computeAllGeoIndicators(JdbcDataSource datasource, String zone, String build Map spatialUnits = createUnitsOfAnalysis(datasource, zone, building, road, rail, vegetation, - water, sea_land_mask, "","", + water, sea_land_mask, "", "", surface_vegetation, - surface_hydro,surface_urban_areas, snappingTolerance, indicatorUse, + surface_hydro, surface_urban_areas, snappingTolerance, indicatorUse, prefixName) if (!spatialUnits) { error "Cannot create the spatial units" @@ -1368,7 +1368,7 @@ Map estimateBuildingHeight(JdbcDataSource datasource, String zone, String buildi String road, String rail, String vegetation, String water, String impervious, String building_estimate, String sea_land_mask, String urban_areas, String rsu, - double surface_vegetation, double surface_hydro,double surface_urban_areas, + double surface_vegetation, double surface_hydro, double surface_urban_areas, double snappingTolerance, String buildingHeightModelName, String prefixName = "") { if (!building_estimate) { error "To estimate the building height a table that contains the list of building to estimate must be provided" @@ -1384,7 +1384,7 @@ Map estimateBuildingHeight(JdbcDataSource datasource, String zone, String buildi Map spatialUnits = createUnitsOfAnalysis(datasource, zone, building, road, rail, vegetation, water, sea_land_mask, urban_areas, rsu, - surface_vegetation, surface_hydro,surface_urban_areas, snappingTolerance, ["UTRF"], + surface_vegetation, surface_hydro, surface_urban_areas, snappingTolerance, ["UTRF"], prefixName) if (!spatialUnits) { error "Cannot create the spatial units" @@ -1435,7 +1435,7 @@ Map estimateBuildingHeight(JdbcDataSource datasource, String zone, String buildi prefixName) def buildingTableName = "BUILDING_TABLE_WITH_RSU_AND_BLOCK_ID" - int nbBuildingEstimated =0 + int nbBuildingEstimated = 0 def buildEstimatedHeight if (datasource.getTable(gatheredScales).isEmpty()) { info "No building height to estimate" @@ -1449,7 +1449,7 @@ Map estimateBuildingHeight(JdbcDataSource datasource, String zone, String buildi info "Start estimating the building height" //Apply RF model buildEstimatedHeight = Geoindicators.TypologyClassification.applyRandomForestModel(datasource, - gatheredScales, buildingHeightModelName,"id_build", prefixName) + gatheredScales, buildingHeightModelName, "id_build", prefixName) if (!buildEstimatedHeight) { error "Cannot apply the building height model $buildingHeightModelName" return @@ -1645,6 +1645,9 @@ String rasterizeIndicators(JdbcDataSource datasource, def grid_column_identifier = "id_grid" def indicatorTablesToJoin = [:] indicatorTablesToJoin.put(grid, grid_column_identifier) + + //An array to execute some commands on the final table + def sqlUpdateCommand =[] /* * Make aggregation process with previous grid and current rsu lcz */ @@ -1845,7 +1848,7 @@ String rasterizeIndicators(JdbcDataSource datasource, "building_type_fraction") if (upperScaleAreaStatistics) { indicatorTablesToJoin.put(upperScaleAreaStatistics, grid_column_identifier) - tablesToDrop< 0) { + // If only one type of surface (land or sea) is in the zone, no need for computational fraction calculation + def sea_land_type_rows = datasource.rows("""SELECT $seaLandTypeField, COUNT(*) AS NB_TYPES FROM $sea_land_mask GROUP BY $seaLandTypeField""".toString()) - if (sea_land_type_rows[seaLandTypeField].count("sea") == 0) { - datasource """ + if (sea_land_type_rows[seaLandTypeField].count("sea") == 0) { + datasource """ DROP TABLE IF EXISTS $seaLandFractionTab; CREATE TABLE $seaLandFractionTab AS SELECT $grid_column_identifier, 1 AS LAND_FRACTION FROM $grid""" - indicatorTablesToJoin.put(seaLandFractionTab, grid_column_identifier) - } else { - // Split the potentially big complex seaLand geometries into smaller triangles in order to makes calculation faster - datasource """ + indicatorTablesToJoin.put(seaLandFractionTab, grid_column_identifier) + } else { + // Split the potentially big complex seaLand geometries into smaller triangles in order to makes calculation faster + datasource """ DROP TABLE IF EXISTS $tesselatedSeaLandTab; CREATE TABLE $tesselatedSeaLandTab(id_tesselate serial, the_geom geometry, $seaLandTypeField VARCHAR) AS SELECT explod_id, the_geom, $seaLandTypeField @@ -1954,21 +1958,26 @@ String rasterizeIndicators(JdbcDataSource datasource, WHERE ST_DIMENSION(the_geom) = 2 AND ST_ISEMPTY(the_geom) IS NOT TRUE AND ST_AREA(the_geom)>0)')""" - def upperScaleAreaStatistics = Geoindicators.GenericIndicators.upperScaleAreaStatistics(datasource, - grid, grid_column_identifier, - tesselatedSeaLandTab, seaLandTypeField, seaLandTypeField, - prefixName) - tablesToDrop << tesselatedSeaLandTab - if (upperScaleAreaStatistics) { - // Modify columns name to postfix with "_FRACTION" - datasource """ + def upperScaleAreaStatistics = Geoindicators.GenericIndicators.upperScaleAreaStatistics(datasource, + grid, grid_column_identifier, + tesselatedSeaLandTab, seaLandTypeField, seaLandTypeField, + prefixName) + tablesToDrop << tesselatedSeaLandTab + if (upperScaleAreaStatistics) { + // Modify columns name to postfix with "_FRACTION" + datasource """ ALTER TABLE ${upperScaleAreaStatistics} RENAME COLUMN TYPE_LAND TO LAND_FRACTION; ALTER TABLE ${upperScaleAreaStatistics} RENAME COLUMN TYPE_SEA TO SEA_FRACTION; ALTER TABLE ${upperScaleAreaStatistics} DROP COLUMN THE_GEOM;""" - indicatorTablesToJoin.put(upperScaleAreaStatistics, grid_column_identifier) - } else { - info "Cannot compute the frontal area index." + indicatorTablesToJoin.put(upperScaleAreaStatistics, grid_column_identifier) + } else { + info "Cannot compute the sea land fractions." + } } + }else{ + //Update the final table + sqlUpdateCommand<<"""ALTER TABLE $grid_indicators_table ADD COLUMN LAND_FRACTION DOUBLE PRECISION DEFAULT 1; + ALTER TABLE $grid_indicators_table ADD COLUMN SEA_FRACTION DOUBLE PRECISION DEFAULT 0;""" } } @@ -2072,6 +2081,9 @@ String rasterizeIndicators(JdbcDataSource datasource, UPDATE $grid_indicators_table SET ASPECT_RATIO = case when building_fraction = 1 then null else free_external_facade_density / (1 - building_fraction) end """.toString()) } + //Execute commands + datasource.execute(sqlUpdateCommand.join(" ")) + tablesToDrop << createScalesRelationsGridBl tablesToDrop << buildingCutted From 43a04e836d258d0589b20f9288d5467da6ba10f8 Mon Sep 17 00:00:00 2001 From: ebocher Date: Fri, 23 Feb 2024 15:14:43 +0100 Subject: [PATCH 5/5] Comment a unit test due to inconsistency OSM tag --- .../geoclimate/osm/WorflowOSMTest.groovy | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) 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 38d0130766..7d32a78f8b 100644 --- a/osm/src/test/groovy/org/orbisgis/geoclimate/osm/WorflowOSMTest.groovy +++ b/osm/src/test/groovy/org/orbisgis/geoclimate/osm/WorflowOSMTest.groovy @@ -652,7 +652,7 @@ class WorflowOSMTest extends WorkflowAbstractTest { def location = "Redon" //def nominatim = org.orbisgis.geoclimate.osmtools.OSMTools.Utilities.getNominatimData("Redon") // location = nominatim.bbox - //location=[47.4, -4.8, 47.6, -4.6] + location=[47.190062,-1.614389,47.196959,-1.602330] def osm_parmeters = [ "description" : "Example of configuration file to run the OSM workflow and store the result in a folder", "geoclimatedb": [ @@ -674,21 +674,21 @@ class WorflowOSMTest extends WorkflowAbstractTest { ["distance" : 0, "rsu_indicators" : [ - "indicatorUse": ["LCZ"] //, "UTRF", "TEB"] + "indicatorUse": ["LCZ", "UTRF", "TEB"] - ]/*,"grid_indicators": [ - "x_size": 200, - "y_size": 200, + ],"grid_indicators": [ + "x_size": 100, + "y_size": 100, //"rowCol": true, "indicators": ["BUILDING_FRACTION","BUILDING_HEIGHT", "BUILDING_POP", - //"BUILDING_TYPE_FRACTION", + "BUILDING_TYPE_FRACTION", "WATER_FRACTION","VEGETATION_FRACTION", "ROAD_FRACTION", "IMPERVIOUS_FRACTION", "LCZ_PRIMARY", - //"BUILDING_HEIGHT_WEIGHTED", //"BUILDING_SURFACE_DENSITY", "SEA_LAND_FRACTION", - "ASPECT_RATIO",//"SVF", + "BUILDING_HEIGHT_WEIGHTED", "BUILDING_SURFACE_DENSITY", "SEA_LAND_FRACTION", + "ASPECT_RATIO","SVF", "HEIGHT_OF_ROUGHNESS_ELEMENTS", "TERRAIN_ROUGHNESS_CLASS"] - ], "worldpop_indicators": true, + ]/*, "worldpop_indicators": true, "road_traffic" : true, "noise_indicators" : [ "ground_acoustic": true @@ -870,7 +870,11 @@ class WorflowOSMTest extends WorkflowAbstractTest { assertTrue h2gis.firstRow("select count(*) as count from $building where HEIGHT_WALL>0 and HEIGHT_ROOF>0").count > 0 } + @Disabled @Test + //TODO : A fix on OSM must be done because Golfe de Gascogne is tagged as a river. + //This geometry must be redesigned because according the International Hydrographic Organization + // Golfe de Gascogne must be considered as bay where some main rivers empty into it void testOneSeaLCZ() { String directory = folder.absolutePath + File.separator + "test_sea_lcz" File dirFile = new File(directory) @@ -893,6 +897,7 @@ class WorflowOSMTest extends WorkflowAbstractTest { def tableNames = process.values() def lcz = tableNames.rsu_lcz[0] H2GIS h2gis = H2GIS.open("${directory + File.separator}sea_lcz_db;AUTO_SERVER=TRUE") + h2gis.save(lcz, "/tmp/sea.geojson", true) def lcz_group= h2gis.firstRow("select lcz_primary, count(*) as count from $lcz group by lcz_primary".toString()) assertTrue(lcz_group.size()==2) assertTrue(lcz_group.lcz_primary==107)