Skip to content

Commit

Permalink
Fix #933
Browse files Browse the repository at this point in the history
  • Loading branch information
ebocher committed Feb 6, 2024
1 parent 57ebec9 commit a5ff116
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a5ff116

Please sign in to comment.