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