diff --git a/bdtopo/src/main/groovy/org/orbisgis/geoclimate/bdtopo/InputDataFormatting.groovy b/bdtopo/src/main/groovy/org/orbisgis/geoclimate/bdtopo/InputDataFormatting.groovy index 0d29295720..2cc0d63e72 100644 --- a/bdtopo/src/main/groovy/org/orbisgis/geoclimate/bdtopo/InputDataFormatting.groovy +++ b/bdtopo/src/main/groovy/org/orbisgis/geoclimate/bdtopo/InputDataFormatting.groovy @@ -66,14 +66,14 @@ String formatBuildingLayer(JdbcDataSource datasource, String building, String zo def types_uses_dictionnary = ["Bâtiment agricole" : ["farm_auxiliary": "agricultural"], "Bâtiment commercial" : ["commercial": "commercial"], - "Bâtiment industriel" : ["light_industry": "industrial"], + "Bâtiment industriel" : ["industrial": "industrial"], "Serre" : ["greenhouse": "agricultural"], "Silo" : ["silo": "agricultural"], - "Aérogare" : ["terminal": "transport"], + "Aérogare" : ["aeroway": "transport"], "Arc de triomphe" : ["monument": "heritage"], "Arène ou théâtre antique" : ["monument": "monument"], "Bâtiment religieux divers" : ["religious": "religious"], - "Bâtiment sportif" : ["sports_centre": "entertainment_arts_culture"], + "Bâtiment sportif" : ["sports_centre": "sport"], "Chapelle" : ["chapel": "religious"], "Château" : ["castle": "heritage"], "Eglise" : ["church": "religious"], @@ -97,48 +97,152 @@ String formatBuildingLayer(JdbcDataSource datasource, String building, String zo "Annexe" : ["annex": "building"], "Industriel, agricole ou commercial": ["commercial": "commercial"], "Bâtiment" : ["building": "building"], - "Industrie lourde" : ["heavy_industry": "industrial"] + "Industrie lourde" : ["industrial": "industrial"] ] - def building_type_level = ["building" : 1, - "annex" : 0, - "house" : 1, - "detached" : 1, - "residential" : 1, - "apartments" : 1, - "bungalow" : 0, - "historic" : 0, - "monument" : 0, - "ruins" : 0, - "castle" : 0, - "agricultural" : 0, - "farm" : 0, - "farm_auxiliary" : 0, - "barn" : 0, - "greenhouse" : 0, - "silo" : 0, - "commercial" : 2, - "industrial" : 0, - "sport" : 0, - "sports_centre" : 0, - "grandstand" : 0, - "transport" : 0, - "train_station" : 0, - "toll_booth" : 0, - "terminal" : 0, - "healthcare" : 1, - "education" : 1, - "entertainment_arts_culture": 0, - "sustenance" : 1, - "military" : 0, - "religious" : 0, - "chapel" : 0, - "church" : 0, - "government" : 1, - "townhall" : 1, - "office" : 1, - "heavy_industry" : 0, - "light_industry" : 0] + def building_type_level = [ + "building": 1, + "house": 1, + "detached": 1, + "residential": 1, + "apartments": 1, + "bungalow": 0, + "historic": 0, + "monument": 0, + "ruins": 0, + "castle": 1, + "agricultural": 0, + "farm": 0, + "farm_auxiliary": 0, + "barn": 0, + "greenhouse": 0, + "silo": 0, + "commercial": 2, + "industrial": 0, + "sport": 0, + "sports_centre": 0, + "grandstand": 0, + "transport": 0, + "train_station": 0, + "toll_booth": 0, + "toll": 0, + "terminal": 0, + "airport_terminal": 0, + "healthcare": 1, + "education": 1, + "entertainment_arts_culture": 0, + "sustenance": 1, + "military": 0, + "religious": 0, + "chapel": 0, + "church": 0, + "government": 1, + "townhall": 1, + "office": 1, + "emergency": 0, + "hotel": 2, + "hospital": 2, + "parking": 1, + "slight_construction": 0, + "water_tower" : 0, + "fortress": 0, + "abbey": 0, + "cathedral": 0, + "mosque": 0, + "musalla": 0, + "temple": 0, + "synagogue": 0, + "shrine": 0, + "place_of_worship": 0, + "wayside_shrine": 0, + "swimming_pool" : 0, + "fitness_centre": 1, + "horse_riding": 0, + "ice_rink" : 0, + "pitch": 0, + "stadium": 0, + "track": 0, + "sports_hall": 0, + "ammunition": 0, + "bunker": 0, + "barracks": 1, + "casemate": 0, + "station": 0, + "government_office": 1, + "stable": 0, + "sty": 0, + "cowshed": 0, + "digester": 0, + "farmhouse": 0, + "bank": 1, + "bureau_de_change": 0, + "boat_rental": 0, + "car_rental" : 0, + "internet_cafe": 0, + "kiosk": 0, + "money_transfer": 0, + "market": 0, + "marketplace": 0, + "pharmacy" : 0, + "post_office" : 1, + "retail": 0, + "shop" : 0, + "store": 0, + "supermarket": 0, + "warehouse": 0, + "factory": 0, + "gas" : 0, + "heating_station": 0, + "oil_mill" : 0, + "oil": 0, + "wellsite": 0, + "well_cluster": 0, + "grain_silo": 0, + "villa": 1, + "dormitory": 1, + "condominium": 1, + "sheltered_housing": 0, + "workers_dormitory" :0, + "terrace": 1, + "transportation": 0, + "hangar": 0, + "tower": 1, + "control_tower": 0, + "aeroway": 1, + "roundhouse": 0, + "social_facility": 1, + "college": 1, + "kindergarten": 0, + "school": 0, + "university": 1, + "cinema": 1, + "arts_centre": 0, + "brothel": 1, + "casino": 0, + "community_centre": 0, + "conference_centre": 1, + "events_venue": 1, + "exhibition_centre": 0, + "gambling": 0, + "music_venue": 0, + "nightclub": 0, + "planetarium": 0, + "social_centre": 0, + "studio": 0, + "theatre": 0, + "library": 1, + "museum": 0, + "aquarium": 0, + "gallery": 0, + "information": 0, + "restaurant": 0, + "bar": 0, + "cafe": 0, + "fast_food": 0, + "ice_cream": 0, + "pub": 0, + "attraction": 0 + ] //Formating building table 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 9595a4a8d3..c61bf1e282 100644 --- a/bdtopo/src/test/groovy/org/orbisgis/geoclimate/bdtopo/WorkflowDebugTest.groovy +++ b/bdtopo/src/test/groovy/org/orbisgis/geoclimate/bdtopo/WorkflowDebugTest.groovy @@ -159,6 +159,7 @@ class WorkflowDebugTest { ["distance" : 0, rsu_indicators : [ "indicatorUse": ["LCZ", "UTRF", "TEB"] + ], "grid_indicators": [ "x_size" : 100, diff --git a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/RsuIndicators.groovy b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/RsuIndicators.groovy index 398df1aef2..a267f7185e 100644 --- a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/RsuIndicators.groovy +++ b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/RsuIndicators.groovy @@ -482,8 +482,7 @@ String projectedFacadeAreaDistribution(JdbcDataSource datasource, String buildin def layerQuery = "DROP TABLE IF EXISTS $buildingLayer; " + "CREATE TABLE $buildingLayer AS SELECT the_geom, " for (i in 1..(listLayersBottom.size() - 1)) { - names[i - 1] = "${BASE_NAME}_H${listLayersBottom[i - 1]}" + - "_${listLayersBottom[i]}" + names.add(getDistribIndicName(BASE_NAME, 'H', listLayersBottom[i - 1], listLayersBottom[i])) layerQuery += "CASEWHEN(z_max <= ${listLayersBottom[i - 1]}, 0, " + "CASEWHEN(z_min >= ${listLayersBottom[i]}, " + "0, ${listLayersBottom[i] - listLayersBottom[i - 1]}-" + @@ -492,8 +491,7 @@ String projectedFacadeAreaDistribution(JdbcDataSource datasource, String buildin } // ...and for the final level - names[listLayersBottom.size() - 1] = "$BASE_NAME" + - "_H${listLayersBottom[listLayersBottom.size() - 1]}" + names.add(getDistribIndicName(BASE_NAME, 'H', listLayersBottom[listLayersBottom.size() - 1], null)) layerQuery += "CASEWHEN(z_max >= ${listLayersBottom[listLayersBottom.size() - 1]}, " + "z_max-GREATEST(z_min,${listLayersBottom[listLayersBottom.size() - 1]}), 0) " + "AS ${names[listLayersBottom.size() - 1]} FROM $buildingFree" @@ -532,24 +530,24 @@ String projectedFacadeAreaDistribution(JdbcDataSource datasource, String buildin def sumNamesDir = [] def queryColumns = [] for (int d = 0; d < numberOfDirection / 2; d++) { - def dirDeg = d * 360 / numberOfDirection + int dirDeg = d * 360 / numberOfDirection def dirRad = toRadians(dirDeg) - def rangeDeg = 360 / numberOfDirection + int rangeDeg = 360 / numberOfDirection def dirRadMid = dirRad + dirMedRad def dirDegMid = dirDeg + dirMedDeg // Define the field name for each of the directions and vertical layers names.each { - namesAndTypeDir += " " + it + "_D${dirDeg}_${dirDeg + rangeDeg} double" + namesAndTypeDir += " " + "${getDistribIndicName(it, 'D', dirDeg, dirDeg + rangeDeg)} double precision" queryColumns += """CASE WHEN a.azimuth-$dirRadMid>PI()/2 THEN a.$it*a.length*COS(a.azimuth-$dirRadMid-PI()/2)/2 WHEN a.azimuth-$dirRadMid<-PI()/2 THEN a.$it*a.length*COS(a.azimuth-$dirRadMid+PI()/2)/2 ELSE a.$it*a.length*ABS(SIN(a.azimuth-$dirRadMid))/2 - END AS ${it}_D${dirDeg}_${dirDeg + rangeDeg}""" + END AS ${getDistribIndicName(it, 'D', dirDeg, dirDeg + rangeDeg)}""" onlyNamesDir += "${it}_D${dirDeg}_${dirDeg + rangeDeg}" sumNamesDir += "COALESCE(SUM(b.${it}_D${dirDeg}_${dirDeg + rangeDeg}), 0) " + - "AS ${it}_D${dirDeg}_${dirDeg + rangeDeg} " + "AS ${getDistribIndicName(it, 'D', dirDeg, dirDeg + rangeDeg)}" } } namesAndTypeDir = namesAndTypeDir.join(",") @@ -584,6 +582,30 @@ String projectedFacadeAreaDistribution(JdbcDataSource datasource, String buildin return outputTableName } +/** + * Create indicator names for building facade and building roof distribution indicators + * + * @param base_name The base name of the indicator + * @param var_type A prefix corresponding to the type of values to come after ("h" for height range and "d" for direction range) + * @param lev_bot The bottom limit of the level (for height range or direction range) + * @param lev_up The upper limit of the level (for height range or direction range) + * + * @return Column (indicator) name + * + * @author Jérémy Bernard + */ +String getDistribIndicName(String base_name, String var_type, Integer lev_bot, Integer lev_up){ + String name + if (lev_up == null){ + name = "${base_name}_${var_type}${lev_bot}" + } + else{ + name = "${base_name}_${var_type}${lev_bot}_${lev_up}" + } + + return name +} + /** * Script to compute both the roof (vertical, horizontal and tilted) * - area within each vertical layer of a RSU. @@ -755,8 +777,8 @@ String roofAreaDistribution(JdbcDataSource datasource, String rsu, String buildi "a.z_max <= ${listLayersBottom[i]}, CASEWHEN(a.delta_h=0, a.non_vertical_roof_area, " + "a.non_vertical_roof_area*(a.z_max-GREATEST(${listLayersBottom[i - 1]},a.z_min))/a.delta_h), " + "CASEWHEN(a.z_min < ${listLayersBottom[i]}, a.non_vertical_roof_area*(${listLayersBottom[i]}-" + - "GREATEST(${listLayersBottom[i - 1]},a.z_min))/a.delta_h, 0)))),0) AS non_vert_roof_area_H" + - "${listLayersBottom[i - 1]}_${listLayersBottom[i]}," + "GREATEST(${listLayersBottom[i - 1]},a.z_min))/a.delta_h, 0)))),0) AS " + + "${getDistribIndicName('non_vert_roof_area', 'H', listLayersBottom[i - 1], listLayersBottom[i])}," vertQuery += " COALESCE(SUM(CASEWHEN(a.z_max <= ${listLayersBottom[i - 1]}, 0, CASEWHEN(" + "a.z_max <= ${listLayersBottom[i]}, CASEWHEN(a.delta_h=0, 0, " + "a.vertical_roof_area*POWER((a.z_max-GREATEST(${listLayersBottom[i - 1]}," + @@ -764,16 +786,16 @@ String roofAreaDistribution(JdbcDataSource datasource, String rsu, String buildi "CASEWHEN(a.z_min>${listLayersBottom[i - 1]}, a.vertical_roof_area*(1-" + "POWER((a.z_max-${listLayersBottom[i]})/a.delta_h,2)),a.vertical_roof_area*(" + "POWER((a.z_max-${listLayersBottom[i - 1]})/a.delta_h,2)-POWER((a.z_max-${listLayersBottom[i]})/" + - "a.delta_h,2))), 0)))),0) AS vert_roof_area_H${listLayersBottom[i - 1]}_${listLayersBottom[i]}," + "a.delta_h,2))), 0)))),0) AS ${getDistribIndicName('vert_roof_area', 'H', listLayersBottom[i - 1], listLayersBottom[i])}," } // The roof area is calculated for the last level (> 50 m in the default case) def valueLastLevel = listLayersBottom[listLayersBottom.size() - 1] nonVertQuery += " COALESCE(SUM(CASEWHEN(a.z_max <= $valueLastLevel, 0, CASEWHEN(a.delta_h=0, a.non_vertical_roof_area, " + - "a.non_vertical_roof_area*(a.z_max-GREATEST($valueLastLevel,a.z_min))/a.delta_h))),0) AS non_vert_roof_area_H" + - "${valueLastLevel}," + "a.non_vertical_roof_area*(a.z_max-GREATEST($valueLastLevel,a.z_min))/a.delta_h))),0) AS " + + "${getDistribIndicName('non_vert_roof_area', 'H', valueLastLevel, null)}," vertQuery += " COALESCE(SUM(CASEWHEN(a.z_max <= $valueLastLevel, 0, CASEWHEN(a.delta_h=0, a.vertical_roof_area, " + - "a.vertical_roof_area*(a.z_max-GREATEST($valueLastLevel,a.z_min))/a.delta_h))),0) AS vert_roof_area_H" + - "${valueLastLevel}," + "a.vertical_roof_area*(a.z_max-GREATEST($valueLastLevel,a.z_min))/a.delta_h))),0) " + + "${getDistribIndicName('vert_roof_area', 'H', valueLastLevel, null)}," def endQuery = """ FROM $buildRoofSurfTot a RIGHT JOIN $rsu b ON a.id_rsu = b.id_rsu GROUP BY b.id_rsu;""" @@ -790,11 +812,11 @@ String roofAreaDistribution(JdbcDataSource datasource, String rsu, String buildi def optionalVert = "(" for (i in 1..(listLayersBottom.size() - 1)) { - optionalNonVert += " a.non_vert_roof_area_H${listLayersBottom[i - 1]}_${listLayersBottom[i]} + " - optionalVert += "a.vert_roof_area_H${listLayersBottom[i - 1]}_${listLayersBottom[i]} + " + optionalNonVert += " a.${getDistribIndicName('non_vert_roof_area', 'H', listLayersBottom[i - 1], listLayersBottom[i])} + " + optionalVert += "a.${getDistribIndicName('vert_roof_area', 'H', listLayersBottom[i - 1], listLayersBottom[i])} + " } - optionalNonVert += "a.non_vert_roof_area_H$valueLastLevel) / ST_AREA(b.$GEOMETRIC_COLUMN_RSU)" - optionalVert += "a.vert_roof_area_H${valueLastLevel}) / ST_AREA(b.$GEOMETRIC_COLUMN_RSU)" + optionalNonVert += "a.${getDistribIndicName('non_vert_roof_area', 'H', valueLastLevel, null)}) / ST_AREA(b.$GEOMETRIC_COLUMN_RSU)" + optionalVert += "a.${getDistribIndicName('vert_roof_area', 'H', valueLastLevel, null)}) / ST_AREA(b.$GEOMETRIC_COLUMN_RSU)" optionalQuery += "$optionalNonVert AS VERT_ROOF_DENSITY, $optionalVert AS NON_VERT_ROOF_DENSITY" + " FROM $optionalTempo a RIGHT JOIN $rsu b ON a.$ID_COLUMN_RSU = b.$ID_COLUMN_RSU;" @@ -992,8 +1014,8 @@ String linearRoadOperations(JdbcDataSource datasource, String rsuTable, String r caseQueryDens = "SUM(ST_LENGTH(the_geom))/rsu_area AS linear_road_density " for (int d = angleRangeSize; d <= 180; d += angleRangeSize) { caseQueryDistrib += "SUM(CASEWHEN(azimuth>=${d - angleRangeSize} AND azimuth<$d, length, 0)) AS " + - "road_direction_distribution_d${d - angleRangeSize}_$d," - nameDistrib.add("road_direction_distribution_d${d - angleRangeSize}_$d") + "${getRoadDirIndic(d, angleRangeSize, null)}," + nameDistrib.add(getRoadDirIndic(d, angleRangeSize, null)) } } // If only certain levels are considered independently @@ -1006,10 +1028,8 @@ String linearRoadOperations(JdbcDataSource datasource, String rsuTable, String r for (int d = angleRangeSize; d <= 180; d += angleRangeSize) { caseQueryDistrib += "SUM(CASEWHEN(azimuth>=${d - angleRangeSize} AND azimuth<$d AND " + "zindex = $lev, length, 0)) AS " + - "road_direction_distribution_h${lev.toString().replaceAll("-", "minus")}" + - "_d${d - angleRangeSize}_$d," - nameDistrib.add("road_direction_distribution_h${lev.toString().replaceAll("-", "minus")}" + - "_d${d - angleRangeSize}_$d") + "${getRoadDirIndic(d, angleRangeSize, lev)}," + nameDistrib.add(getRoadDirIndic(d, angleRangeSize, lev)) } } } @@ -1085,6 +1105,30 @@ String linearRoadOperations(JdbcDataSource datasource, String rsuTable, String r } } +/** + * Create indicator names for road distribution indicators + * + * @param d The upper limit of the angle considered for road direction (°) + * @param angleRangeSize the angle range + * @param lev The level of the roads + * + * @return Column (indicator) name + * + * @author Jérémy Bernard + */ +String getRoadDirIndic(int d, Integer angleRangeSize, Integer lev){ + String name + if(lev == null){ + name = "road_direction_distribution_d${d - angleRangeSize}_$d" + } + else{ + name = "road_direction_distribution_h${lev.toString().replaceAll("-", "minus")}" + + "_d${d - angleRangeSize}_$d" + } + + return name +} + /** * Script to compute the effective terrain class from the terrain roughness length (z0). * The classes are defined according to the Davenport lookup Table (cf Table 5 in Stewart and Oke, 2012) diff --git a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/TypologyClassification.groovy b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/TypologyClassification.groovy index 2bee5f8257..eb4715e4dc 100644 --- a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/TypologyClassification.groovy +++ b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/TypologyClassification.groovy @@ -234,7 +234,7 @@ String identifyLczType(JdbcDataSource datasource, String rsuLczIndicators, Strin datasource """DROP TABLE IF EXISTS $urbanLCZ; CREATE TABLE $urbanLCZ AS SELECT a.*, - a.AREA_FRACTION_COMMERCIAL + a.AREA_FRACTION_LIGHT_INDUSTRY AS AREA_FRACTION_LOWRISE_TYPO + a.AREA_FRACTION_COMMERCIAL_LCZ + a.AREA_FRACTION_LIGHT_INDUSTRY_LCZ AS AREA_FRACTION_LOWRISE_TYPO FROM $rsuAllIndicators a LEFT JOIN $ruralLCZ b ON a.$ID_FIELD_RSU = b.$ID_FIELD_RSU @@ -242,11 +242,11 @@ String identifyLczType(JdbcDataSource datasource, String rsuLczIndicators, Strin // 0. Set as industrial areas or large low-rise (commercial) having more of industrial or commercial than residential // and at least 1/3 of fraction - if (datasource.getColumnNames(urbanLCZ).contains("AREA_FRACTION_HEAVY_INDUSTRY")) { + if (datasource.getColumnNames(urbanLCZ).contains("AREA_FRACTION_HEAVY_INDUSTRY_LCZ")) { datasource """DROP TABLE IF EXISTS $classifiedIndustrialCommercialLcz; CREATE TABLE $classifiedIndustrialCommercialLcz AS SELECT $ID_FIELD_RSU, - CASE WHEN AREA_FRACTION_HEAVY_INDUSTRY > AREA_FRACTION_LOWRISE_TYPO + CASE WHEN AREA_FRACTION_HEAVY_INDUSTRY_LCZ > AREA_FRACTION_LOWRISE_TYPO THEN 10 ELSE 8 END AS LCZ1, null AS LCZ2, @@ -254,8 +254,8 @@ String identifyLczType(JdbcDataSource datasource, String rsuLczIndicators, Strin null AS LCZ_UNIQUENESS_VALUE, null AS LCZ_EQUALITY_VALUE FROM $urbanLCZ - WHERE AREA_FRACTION_HEAVY_INDUSTRY > AREA_FRACTION_LOWRISE_TYPO AND AREA_FRACTION_HEAVY_INDUSTRY>0.33 - OR AREA_FRACTION_LOWRISE_TYPO > AREA_FRACTION_RESIDENTIAL AND AREA_FRACTION_LOWRISE_TYPO>0.33 + WHERE AREA_FRACTION_HEAVY_INDUSTRY_LCZ > AREA_FRACTION_LOWRISE_TYPO AND AREA_FRACTION_HEAVY_INDUSTRY_LCZ>0.33 + OR AREA_FRACTION_LOWRISE_TYPO > AREA_FRACTION_RESIDENTIAL_LCZ AND AREA_FRACTION_LOWRISE_TYPO>0.33 AND AVG_NB_LEV_AREA_WEIGHTED < 3 AND LOW_VEGETATION_FRACTION_LCZ+HIGH_VEGETATION_FRACTION_LCZ<0.2 AND GROUND_SKY_VIEW_FACTOR > 0.7; 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 b161d10b50..b6dd6cc24c 100644 --- a/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy +++ b/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicators.groovy @@ -338,11 +338,14 @@ String computeBlockIndicators(JdbcDataSource datasource, String inputBuildingTab * of overlapped layers (for example a geometry containing water and low_vegetation must be either water * or either low_vegetation, not both (default ["water", "building", "high_vegetation", "low_vegetation", * "road", "impervious"] - * @param buildingAreaTypeAndComposition Building type proportion that should be calculated (default: ["light_industry": ["light_industry"], - * "heavy_industry": ["heavy_industry"], - * "commercial":["commercial"], - * "residential": ["residential"]]) - * @param floorAreaTypeAndComposition Building floor area type proportion that should be calculated (default: ["residential": ["residential"]]) + * @param buildingAreaTypeAndCompositionLcz Building type proportion that should be calculated for LCZ classification + * (see default value in the function signature) + * @param floorAreaTypeAndCompositionLcz Building floor area type proportion that should be calculated for LCZ classification + * (see default value in the function signature) + * @param buildingAreaTypeAndCompositionTeb Building type proportion that should be calculated for the TEB model + * (see default value in the function signature) + * @param floorAreaTypeAndCompositionTeb Building floor area type proportion that should be calculated for the TEB model + * (see default value in the function signature) * @param utrfSurfFraction Map containing as key the name of the fraction indicators useful for the urban typology classification * and as value a list of the fractions that have to be summed up to calculate the indicator. No need to modify * these values if not interested by the urban typology @@ -356,66 +359,126 @@ String computeBlockIndicators(JdbcDataSource datasource, String inputBuildingTab */ String computeRSUIndicators(JdbcDataSource datasource, String buildingTable, String rsu, String vegetation, String road, String water, String impervious, String rail, Map parameters = - [facadeDensListLayersBottom : [0, 10, 20, 30, 40, 50], - facadeDensNumberOfDirection : 12, - svfPointDensity : 0.008, - svfRayLength : 100, - svfNumberOfDirection : 60, - heightColumnName : "height_roof", - inputFields : ["id_build", "the_geom"], - levelForRoads : [0], - angleRangeSizeBuDirection : 30, - svfSimplified : true, - indicatorUse : ["LCZ", "UTRF", "TEB"], - surfSuperpositions : ["high_vegetation": ["water", "building", "low_vegetation", "rail", "road", "impervious"]], - surfPriorities : ["water", "building", "high_vegetation", "low_vegetation", "rail", "road", "impervious"], - buildingAreaTypeAndComposition: ["light_industry": ["light_industry"], - "heavy_industry": ["heavy_industry"], - "commercial" : ["commercial"], - "residential" : ["residential"]], - floorAreaTypeAndComposition : ["residential": ["residential"]], - utrfSurfFraction : ["vegetation_fraction_utrf" : ["high_vegetation_fraction", + [facadeDensListLayersBottom : [0, 10, 20, 30, 40, 50], + facadeDensNumberOfDirection : 12, + svfPointDensity : 0.008, + svfRayLength : 100, + svfNumberOfDirection : 60, + heightColumnName : "height_roof", + inputFields : ["id_build", "the_geom"], + levelForRoads : [0], + angleRangeSizeBuDirection : 30, + angleRangeSizeRoDirection : 30, + svfSimplified : true, + indicatorUse : ["LCZ", "UTRF", "TEB"], + surfSuperpositions : ["high_vegetation": ["water", "building", "low_vegetation", "rail", "road", "impervious"]], + surfPriorities : ["water", "building", "high_vegetation", "low_vegetation", "rail", "road", "impervious"], + buildingAreaTypeAndCompositionLcz : ["light_industry_lcz": ["industrial", "factory", "warehouse", "port"], + "commercial_lcz": ["commercial", "shop", "retail", "port", + "exhibition_centre", "cinema"], + "heavy_industry_lcz": ["refinery"], + "residential_lcz" : ["house", "detached", "bungalow", "farm", "apartments", "barracks", + "abbey", "condominium", "villa", "dormitory", "sheltered_housing", + "workers_dormitory", "terrace", "residential"]], + floorAreaTypeAndCompositionLcz : [:], + buildingAreaTypeAndCompositionTeb : ["individual_housing": ["house", "detached", "bungalow", "farm", "villa", "terrace"], + "collective_housing": [ "apartments","barracks","abbey", "dormitory", + "sheltered_housing", "workers_dormitory", + "condominium"], + "other_residential": ["residential"], + "commercial" : ["commercial","internet_cafe","money_transfer","pharmacy", + "post_office","cinema","arts_centre", "brothel", "casino", + "sustenance","hotel","restaurant","bar","cafe","fast_food", + "ice_cream","pub","aquarium"], + "tertiary" : [ "government", "townhall", "retail","gambling","music_venue", "nightclub", + "shop","store","supermarket","office","terminal","airport_terminal","bank", + "bureau_de_change","boat_rental","car_rental","research_institute", + "community_centre", "conference_centre","events_venue", + "exhibition_centre","social_centre","studio","theatre", + "library","healthcare","entertainment_arts_culture", + "hospital", "information"], + "education" : [ "education","swimming-pool", "fitness_centre","sports_centre", + "college","kindergarten","school","university","museum","gallery"], + "light_industrial" : ["industrial", "factory", "warehouse", "port"], + "heavy_industrial" : ["refinery"], + "non_heated" : [ "silo", "barn", "cowshed","ruins","church","chapel","military", + "castle","monument","fortress","synagogue","mosquee","musalla", + "shrine","cathedral", "agricultural", "farm_auxiliary","digester", + "horse_riding","stadium","track","pitch", "ice_rink","sports_hall", + "ammunition","bunker","casemate","shelter","religious","place_of_worship", + "wayside_shrine","station","stable","sty","greenhouse","kiosk","marketplace", + "marker","warehouse","planetarium","fire_station","water_tower","grandstand", + "transportation","toll_booth"]], + floorAreaTypeAndCompositionTeb : ["individual_housing": ["house", "detached", "bungalow", "farm", "villa", "terrace"], + "collective_housing": [ "apartments","barracks","abbey", "dormitory", + "sheltered_housing", "workers_dormitory", + "condominium", "residential"], + "other_residential": ["residential"], + "commercial" : ["commercial","internet_cafe","money_transfer","pharmacy", + "post_office","cinema","arts_centre", "brothel", "casino", + "sustenance","hotel","restaurant","bar","cafe","fast_food", + "ice_cream","pub","aquarium"], + "tertiary" : [ "government", "townhall", "retail","gambling","music_venue", "nightclub", + "shop","store","supermarket","office","terminal","airport_terminal","bank", + "bureau_de_change","boat_rental","car_rental","research_institute", + "community_centre", "conference_centre","events_venue", + "exhibition_centre","social_centre","studio","theatre", + "library","healthcare","entertainment_arts_culture", + "hospital", "information"], + "education" : [ "education","swimming-pool", "fitness_centre","sports_centre", + "college","kindergarten","school","university","museum","gallery"], + "light_industrial" : ["industrial", "factory", "warehouse", "port"], + "heavy_industrial" : ["refinery"], + "non_heated" : [ "silo", "barn", "cowshed","ruins","church","chapel","military", + "castle","monument","fortress","synagogue","mosquee","musalla", + "shrine","cathedral", "agricultural", "farm_auxiliary","digester", + "horse_riding","stadium","track","pitch", "ice_rink","sports_hall", + "ammunition","bunker","casemate","shelter","religious","place_of_worship", + "wayside_shrine","station","stable","sty","greenhouse","kiosk","marketplace", + "marker","warehouse","planetarium","fire_station","water_tower","grandstand", + "transportation","toll_booth"]], + utrfSurfFraction : ["vegetation_fraction_utrf" : ["high_vegetation_fraction", "low_vegetation_fraction", "high_vegetation_low_vegetation_fraction", "high_vegetation_road_fraction", "high_vegetation_impervious_fraction", "high_vegetation_water_fraction", "high_vegetation_building_fraction"], - "low_vegetation_fraction_utrf" : ["low_vegetation_fraction"], - "high_vegetation_impervious_fraction_utrf": ["high_vegetation_road_fraction", - "high_vegetation_impervious_fraction"], - "high_vegetation_pervious_fraction_utrf" : ["high_vegetation_fraction", - "high_vegetation_low_vegetation_fraction", - "high_vegetation_water_fraction"], - "road_fraction_utrf" : ["road_fraction", - "high_vegetation_road_fraction"], - "impervious_fraction_utrf" : ["road_fraction", - "high_vegetation_road_fraction", - "impervious_fraction", - "high_vegetation_impervious_fraction"]], - lczSurfFraction : ["building_fraction_lcz" : ["building_fraction", - "high_vegetation_building_fraction"], - "pervious_fraction_lcz" : ["high_vegetation_fraction", - "low_vegetation_fraction", - "water_fraction", - "high_vegetation_low_vegetation_fraction", - "high_vegetation_water_fraction"], - "high_vegetation_fraction_lcz": ["high_vegetation_fraction", - "high_vegetation_low_vegetation_fraction", - "high_vegetation_road_fraction", - "high_vegetation_impervious_fraction", - "high_vegetation_water_fraction", - "high_vegetation_building_fraction"], - "low_vegetation_fraction_lcz" : ["low_vegetation_fraction"], - "impervious_fraction_lcz" : ["impervious_fraction", - "road_fraction", - "rail_fraction", - "high_vegetation_impervious_fraction", - "high_vegetation_road_fraction", - "high_vegetation_rail_fraction"], - "water_fraction_lcz" : ["water_fraction", + "low_vegetation_fraction_utrf" : ["low_vegetation_fraction"], + "high_vegetation_impervious_fraction_utrf": ["high_vegetation_road_fraction", + "high_vegetation_impervious_fraction"], + "high_vegetation_pervious_fraction_utrf" : ["high_vegetation_fraction", + "high_vegetation_low_vegetation_fraction", + "high_vegetation_water_fraction"], + "road_fraction_utrf" : ["road_fraction", + "high_vegetation_road_fraction"], + "impervious_fraction_utrf" : ["road_fraction", + "high_vegetation_road_fraction", + "impervious_fraction", + "high_vegetation_impervious_fraction"]], + lczSurfFraction : ["building_fraction_lcz" : ["building_fraction", + "high_vegetation_building_fraction"], + "pervious_fraction_lcz" : ["high_vegetation_fraction", + "low_vegetation_fraction", + "water_fraction", + "high_vegetation_low_vegetation_fraction", + "high_vegetation_water_fraction"], + "high_vegetation_fraction_lcz": ["high_vegetation_fraction", + "high_vegetation_low_vegetation_fraction", + "high_vegetation_road_fraction", + "high_vegetation_impervious_fraction", + "high_vegetation_water_fraction", + "high_vegetation_building_fraction"], + "low_vegetation_fraction_lcz" : ["low_vegetation_fraction"], + "impervious_fraction_lcz" : ["impervious_fraction", + "road_fraction", + "rail_fraction", + "high_vegetation_impervious_fraction", + "high_vegetation_road_fraction", + "high_vegetation_rail_fraction"], + "water_fraction_lcz" : ["water_fraction", "high_vegetation_water_fraction"]], - buildingFractions : ["high_vegetation_building_fraction", "building_fraction"]], String prefixName = "") { + buildingFractions : ["high_vegetation_building_fraction", "building_fraction"]], String prefixName = "") { info "Start computing RSU indicators..." def to_start = System.currentTimeMillis() @@ -523,15 +586,25 @@ String computeRSUIndicators(JdbcDataSource datasource, String buildingTable, } // building type fractions - if (indicatorUse*.toUpperCase().contains("UTRF") || indicatorUse*.toUpperCase().contains("LCZ")) { - def rsuTableTypeProportion = Geoindicators.GenericIndicators.typeProportion(datasource, buildingTable, - columnIdRsu, "type", rsu, parameters.buildingAreaTypeAndComposition, - parameters.floorAreaTypeAndComposition, temporaryPrefName) - if (!rsuTableTypeProportion) { - info "Cannot compute the building type proportion of the RSU" + if (indicatorUse*.toUpperCase().contains("LCZ")) { + def rsuTableTypeProportionLcz = Geoindicators.GenericIndicators.typeProportion(datasource, buildingTable, + columnIdRsu, "type", rsu, parameters.buildingAreaTypeAndCompositionLcz, + parameters.floorAreaTypeAndCompositionLcz, temporaryPrefName + "_LCZ") + if (!rsuTableTypeProportionLcz) { + info "Cannot compute the building type proportion for the LCZ at the RSU scale" + return + } + finalTablesToJoin.put(rsuTableTypeProportionLcz, columnIdRsu) + } + if (indicatorUse*.toUpperCase().contains("TEB")) { + def rsuTableTypeProportionTeb = Geoindicators.GenericIndicators.typeProportion(datasource, buildingTable, + columnIdRsu, "type", rsu, parameters.buildingAreaTypeAndCompositionTeb, + parameters.floorAreaTypeAndCompositionTeb, temporaryPrefName + "_TEB") + if (!rsuTableTypeProportionTeb) { + info "Cannot compute the building type proportion for TEB at the RSU scale" return } - finalTablesToJoin.put(rsuTableTypeProportion, columnIdRsu) + finalTablesToJoin.put(rsuTableTypeProportionTeb, columnIdRsu) } // rsu_area (note that the uuid is used as prefix for intermediate tables - indicator alone in a table) @@ -609,7 +682,7 @@ String computeRSUIndicators(JdbcDataSource datasource, String buildingTable, roadOperations = ["road_direction_distribution", "linear_road_density"] } def linearRoadOperations = Geoindicators.RsuIndicators.linearRoadOperations(datasource, rsu, - road, roadOperations, 30, [0], temporaryPrefName) + road, roadOperations, parameters.angleRangeSizeRoDirection, [0], temporaryPrefName) if (!linearRoadOperations) { info "Cannot compute the linear road density and road direction distribution" return @@ -1130,13 +1203,76 @@ Map getParameters() { "inputFields" : ["id_build", "the_geom"], "levelForRoads" : [0], "angleRangeSizeBuDirection" : 30, + "angleRangeSizeRoDirection" : 30, "surfSuperpositions" : ["high_vegetation": ["water", "building", "low_vegetation", "rail", "road", "impervious"]], "surfPriorities" : ["water", "building", "high_vegetation", "low_vegetation", "rail", "road", "impervious"], - "buildingAreaTypeAndComposition": ["light_industry": ["light_industry"], - "heavy_industry": ["heavy_industry"], - "commercial" : ["commercial"], - "residential" : ["residential"]], - "floorAreaTypeAndComposition" : ["residential": ["residential"]], + "buildingAreaTypeAndCompositionLcz" : ["undefined_lcz": ["building"], + "light_industry_lcz": ["industrial", "factory", "warehouse", "port"], + "commercial_lcz": ["commercial", "shop", "retail", "port", + "exhibition_centre", "cinema"], + "heavy_industry_lcz": ["refinery"], + "residential_lcz" : ["house", "detached", "bungalow", "farm", "apartments", "barracks", + "abbey", "condominium", "villa", "dormitory", "sheltered_housing", + "workers_dormitory", "terrace", "residential"]], + "floorAreaTypeAndCompositionLcz" : [:], + "buildingAreaTypeAndCompositionTeb" : ["undefined": ["building"], + "individual_housing": ["house", "detached", "bungalow", "farm", "villa", "terrace"], + "collective_housing": [ "apartments","barracks","abbey", "dormitory", + "sheltered_housing", "workers_dormitory", + "condominium", "residential"], + "other_residential": ["residential"], + "commercial" : ["commercial","internet_cafe","money_transfer","pharmacy", + "post_office","cinema","arts_centre", "brothel", "casino", + "sustenance","hotel","restaurant","bar","cafe","fast_food", + "ice_cream","pub","aquarium"], + "tertiary" : [ "government", "townhall", "retail","gambling","music_venue", "nightclub", + "shop","store","supermarket","office","terminal","airport_terminal","bank", + "bureau_de_change","boat_rental","car_rental","research_institute", + "community_centre", "conference_centre","events_venue", + "exhibition_centre","social_centre","studio","theatre", + "library","healthcare","entertainment_arts_culture", + "hospital", "information"], + "education" : [ "education","swimming-pool", "fitness_centre","sports_centre", + "college","kindergarten","school","university","museum","gallery"], + "light_industrial" : ["industrial", "factory", "warehouse", "port"], + "heavy_industrial" : ["refinery"], + "non_heated" : [ "silo", "barn", "cowshed","ruins","church","chapel","military", + "castle","monument","fortress","synagogue","mosquee","musalla", + "shrine","cathedral", "agricultural", "farm_auxiliary","digester", + "horse_riding","stadium","track","pitch", "ice_rink","sports_hall", + "ammunition","bunker","casemate","shelter","religious","place_of_worship", + "wayside_shrine","station","stable","sty","greenhouse","kiosk","marketplace", + "marker","warehouse","planetarium","fire_station","water_tower","grandstand", + "transportation","toll_booth"]], + "floorAreaTypeAndCompositionTeb" : ["undefined": ["building"], + "individual_housing": ["house", "detached", "bungalow", "farm", "villa", "terrace"], + "collective_housing": [ "apartments","barracks","abbey", "dormitory", + "sheltered_housing", "workers_dormitory", + "condominium", "residential"], + "other_residential": ["residential"], + "commercial" : ["commercial","internet_cafe","money_transfer","pharmacy", + "post_office","cinema","arts_centre", "brothel", "casino", + "sustenance","hotel","restaurant","bar","cafe","fast_food", + "ice_cream","pub","aquarium"], + "tertiary" : [ "government", "townhall", "retail","gambling","music_venue", "nightclub", + "shop","store","supermarket","office","terminal","airport_terminal","bank", + "bureau_de_change","boat_rental","car_rental","research_institute", + "community_centre", "conference_centre","events_venue", + "exhibition_centre","social_centre","studio","theatre", + "library","healthcare","entertainment_arts_culture", + "hospital", "information"], + "education" : [ "education","swimming-pool", "fitness_centre","sports_centre", + "college","kindergarten","school","university","museum","gallery"], + "light_industrial" : ["industrial", "factory", "warehouse", "port"], + "heavy_industrial" : ["refinery"], + "non_heated" : [ "silo", "barn", "cowshed","ruins","church","chapel","military", + "castle","monument","fortress","synagogue","mosquee","musalla", + "shrine","cathedral", "agricultural", "farm_auxiliary","digester", + "horse_riding","stadium","track","pitch", "ice_rink","sports_hall", + "ammunition","bunker","casemate","shelter","religious","place_of_worship", + "wayside_shrine","station","stable","sty","greenhouse","kiosk","marketplace", + "marker","warehouse","planetarium","fire_station","water_tower","grandstand", + "transportation","toll_booth"]], "utrfSurfFraction" : ["vegetation_fraction_utrf" : ["high_vegetation_fraction", "low_vegetation_fraction", "high_vegetation_low_vegetation_fraction", diff --git a/geoindicators/src/test/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicatorsTest.groovy b/geoindicators/src/test/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicatorsTest.groovy index f6df2cc403..976a57f348 100644 --- a/geoindicators/src/test/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicatorsTest.groovy +++ b/geoindicators/src/test/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicatorsTest.groovy @@ -39,76 +39,29 @@ class WorkflowGeoIndicatorsTest { public static Logger logger = LoggerFactory.getLogger(WorkflowGeoIndicatorsTest.class) - // Indicator list (at RSU scale) for each type of use - public static listNames = [ - "TEB" : ["VERT_ROOF_DENSITY", "NON_VERT_ROOF_DENSITY", - "ROAD_DIRECTION_DISTRIBUTION_H0_D0_30", "ROAD_DIRECTION_DISTRIBUTION_H0_D60_90", - "ROAD_DIRECTION_DISTRIBUTION_H0_D90_120", "ROAD_DIRECTION_DISTRIBUTION_H0_D120_150", - "ROAD_DIRECTION_DISTRIBUTION_H0_D150_180", "ROAD_DIRECTION_DISTRIBUTION_H0_D30_60", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H0_10_D0_30", "PROJECTED_FACADE_AREA_DISTRIBUTION_H10_20_D0_30", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H20_30_D0_30", "PROJECTED_FACADE_AREA_DISTRIBUTION_H30_40_D0_30", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H40_50_D0_30", "PROJECTED_FACADE_AREA_DISTRIBUTION_H50_D0_30", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H0_10_D30_60", "PROJECTED_FACADE_AREA_DISTRIBUTION_H10_20_D30_60", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H20_30_D30_60", "PROJECTED_FACADE_AREA_DISTRIBUTION_H30_40_D30_60", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H40_50_D30_60", "PROJECTED_FACADE_AREA_DISTRIBUTION_H50_D30_60", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H0_10_D60_90", "PROJECTED_FACADE_AREA_DISTRIBUTION_H10_20_D60_90", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H20_30_D60_90", "PROJECTED_FACADE_AREA_DISTRIBUTION_H30_40_D60_90", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H40_50_D60_90", "PROJECTED_FACADE_AREA_DISTRIBUTION_H50_D60_90", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H0_10_D90_120", "PROJECTED_FACADE_AREA_DISTRIBUTION_H10_20_D90_120", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H20_30_D90_120", "PROJECTED_FACADE_AREA_DISTRIBUTION_H30_40_D90_120", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H40_50_D90_120", "PROJECTED_FACADE_AREA_DISTRIBUTION_H50_D90_120", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H0_10_D120_150", "PROJECTED_FACADE_AREA_DISTRIBUTION_H10_20_D120_150", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H20_30_D120_150", "PROJECTED_FACADE_AREA_DISTRIBUTION_H30_40_D120_150", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H40_50_D120_150", "PROJECTED_FACADE_AREA_DISTRIBUTION_H50_D120_150", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H0_10_D150_180", "PROJECTED_FACADE_AREA_DISTRIBUTION_H10_20_D150_180", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H20_30_D150_180", "PROJECTED_FACADE_AREA_DISTRIBUTION_H30_40_D150_180", - "PROJECTED_FACADE_AREA_DISTRIBUTION_H40_50_D150_180", "PROJECTED_FACADE_AREA_DISTRIBUTION_H50_D150_180", - "NON_VERT_ROOF_AREA_H0_10", "NON_VERT_ROOF_AREA_H10_20", "NON_VERT_ROOF_AREA_H20_30", - "NON_VERT_ROOF_AREA_H30_40", "NON_VERT_ROOF_AREA_H40_50", "NON_VERT_ROOF_AREA_H50", - "VERT_ROOF_AREA_H0_10", "VERT_ROOF_AREA_H10_20", "VERT_ROOF_AREA_H20_30", "VERT_ROOF_AREA_H30_40", - "VERT_ROOF_AREA_H40_50", "VERT_ROOF_AREA_H50", "EFFECTIVE_TERRAIN_ROUGHNESS_LENGTH"], - "UTRF": ["AREA", "ASPECT_RATIO", "BUILDING_TOTAL_FRACTION", "FREE_EXTERNAL_FACADE_DENSITY", - "VEGETATION_FRACTION_UTRF", "LOW_VEGETATION_FRACTION_UTRF", "HIGH_VEGETATION_IMPERVIOUS_FRACTION_UTRF", - "HIGH_VEGETATION_PERVIOUS_FRACTION_UTRF", "ROAD_FRACTION_UTRF", "IMPERVIOUS_FRACTION_UTRF", - "AVG_NUMBER_BUILDING_NEIGHBOR", "AVG_HEIGHT_ROOF_AREA_WEIGHTED", - "STD_HEIGHT_ROOF_AREA_WEIGHTED", "BUILDING_NUMBER_DENSITY", "BUILDING_VOLUME_DENSITY", - "BUILDING_VOLUME_DENSITY", "AVG_VOLUME", "GROUND_LINEAR_ROAD_DENSITY", - "GEOM_AVG_HEIGHT_ROOF", "BUILDING_FLOOR_AREA_DENSITY", - "AVG_MINIMUM_BUILDING_SPACING", "MAIN_BUILDING_DIRECTION", "BUILDING_DIRECTION_UNIQUENESS", - "BUILDING_DIRECTION_EQUALITY", "AREA_FRACTION_LIGHT_INDUSTRY", "FLOOR_AREA_FRACTION_RESIDENTIAL"], - "LCZ" : ["BUILDING_FRACTION_LCZ", "ASPECT_RATIO", "GROUND_SKY_VIEW_FACTOR", "PERVIOUS_FRACTION_LCZ", - "IMPERVIOUS_FRACTION_LCZ", "GEOM_AVG_HEIGHT_ROOF", "EFFECTIVE_TERRAIN_ROUGHNESS_LENGTH", "EFFECTIVE_TERRAIN_ROUGHNESS_CLASS", - "HIGH_VEGETATION_FRACTION_LCZ", "LOW_VEGETATION_FRACTION_LCZ", "WATER_FRACTION_LCZ", "AREA_FRACTION_LIGHT_INDUSTRY", - "FLOOR_AREA_FRACTION_RESIDENTIAL"]] + public static listNames // Basic columns at RSU scale - public static listColBasic = ["ID_RSU", "THE_GEOM"] - + public static listColBasic // Indicators common to each indicator use - public static listColCommon = ["LOW_VEGETATION_FRACTION", "HIGH_VEGETATION_FRACTION", - "BUILDING_FRACTION", "WATER_FRACTION", "ROAD_FRACTION", "IMPERVIOUS_FRACTION", - "HIGH_VEGETATION_LOW_VEGETATION_FRACTION", "HIGH_VEGETATION_WATER_FRACTION", - "HIGH_VEGETATION_ROAD_FRACTION", "HIGH_VEGETATION_IMPERVIOUS_FRACTION", - "HIGH_VEGETATION_BUILDING_FRACTION", "UNDEFINED_FRACTION"] - + public static listColCommon // Column names in the LCZ Table - public static listColLcz = ["LCZ_PRIMARY", "LCZ_SECONDARY", "LCZ_EQUALITY_VALUE", "LCZ_UNIQUENESS_VALUE", "MIN_DISTANCE"] - + public static listColLcz // Indicator lists for urban typology use at building and block scales - public static listUrbTyp = - ["Bu": ["THE_GEOM", "ID_RSU", "ID_BUILD", "ID_BLOCK", "NB_LEV", "ZINDEX", "MAIN_USE", "TYPE", "ID_SOURCE", - "HEIGHT_ROOF", "HEIGHT_WALL", "PERIMETER", "AREA", "VOLUME", "FLOOR_AREA", "TOTAL_FACADE_LENGTH", "COMMON_WALL_FRACTION", - "CONTIGUITY", "AREA_CONCAVITY", "FORM_FACTOR", "RAW_COMPACTNESS", "PERIMETER_CONVEXITY", - "MINIMUM_BUILDING_SPACING", "NUMBER_BUILDING_NEIGHBOR", "ROAD_DISTANCE", "LIKELIHOOD_LARGE_BUILDING"], - "Bl": ["THE_GEOM", "ID_RSU", "ID_BLOCK", "AREA", "FLOOR_AREA", "VOLUME", "HOLE_AREA_DENSITY", "MAIN_BUILDING_DIRECTION", - "BUILDING_DIRECTION_UNIQUENESS", "BUILDING_DIRECTION_EQUALITY", "CLOSINGNESS", "NET_COMPACTNESS", - "AVG_HEIGHT_ROOF_AREA_WEIGHTED", "STD_HEIGHT_ROOF_AREA_WEIGHTED"]] + public static listUrbTyp + // Indicator list for testing sum of all fractions + public static listBuildTypTeb + public static listBuildTypLcz + public static listFloorBuildTypLcz + public static listFloorBuildTypTeb public static H2GIS datasource public static def inputTableNames + public @BeforeAll static void beforeAll() { + initParameters() datasource = open(folder.getAbsolutePath() + File.separator + "workflowGeoIndicatorsTest;AUTO_SERVER=TRUE") assertNotNull(datasource) datasource.load(WorkflowGeoIndicatorsTest.getResource("BUILDING.geojson"), "BUILDING", true) @@ -120,6 +73,103 @@ class WorkflowGeoIndicatorsTest { railTable: "RAIL", vegetationTable: "VEGET", hydrographicTable: "HYDRO"] } + // Indicator list (at RSU scale) for each type of use + /** + * Init some parameters to run the tests + */ + static void initParameters() { + Map parameters = Geoindicators.WorkflowGeoIndicators.getParameters() + // Indicator list (at RSU scale) for each type of use + listBuildTypTeb = [] + listBuildTypLcz = [] + listFloorBuildTypLcz = [] + listFloorBuildTypTeb = [] + for (type in parameters.buildingAreaTypeAndCompositionTeb.keySet()) { + listBuildTypTeb.add("AREA_FRACTION_${type}".toString().toUpperCase()) + } + for (type in parameters.floorAreaTypeAndCompositionTeb.keySet()) { + listFloorBuildTypTeb.add("FLOOR_AREA_FRACTION_${type}".toString().toUpperCase()) + } + for (type in parameters.buildingAreaTypeAndCompositionLcz.keySet()) { + listBuildTypLcz.add("AREA_FRACTION_${type}".toString().toUpperCase()) + } + for (type in parameters.floorAreaTypeAndCompositionLcz.keySet()) { + listFloorBuildTypLcz.add("FLOOR_AREA_FRACTION_${type}".toString().toUpperCase()) + } + + // Indicator list (at RSU scale) for each road direction + List listRoadDir = [] + for (int d = parameters.angleRangeSizeRoDirection; d <= 180; d += parameters.angleRangeSizeRoDirection) { + listRoadDir.add(Geoindicators.RsuIndicators.getRoadDirIndic(d, parameters.angleRangeSizeRoDirection, 0).toString().toUpperCase()) + } + + // Indicator list (at RSU scale) for each facade direction and height (projected facade distrib) + // and also for height only (vert and non vert roof density) + List listFacadeDistrib = [] + List listHeightDistrib = [] + int rangeDeg = 360 / parameters.facadeDensNumberOfDirection + for (int i in 0..parameters.facadeDensListLayersBottom.size()-1) { + Integer h_bot = parameters.facadeDensListLayersBottom[i] + Integer h_up + if (h_bot == parameters.facadeDensListLayersBottom[-1]) { + h_up = null + } else { + h_up = parameters.facadeDensListLayersBottom[i + 1] + } + // Create names for vert and non vert roof density + listHeightDistrib.add(Geoindicators.RsuIndicators.getDistribIndicName("vert_roof_area", 'h', h_bot, h_up).toString().toUpperCase()) + listHeightDistrib.add(Geoindicators.RsuIndicators.getDistribIndicName("non_vert_roof_area", 'h', h_bot, h_up).toString().toUpperCase()) + + // Create names for facade density + String name_h = Geoindicators.RsuIndicators.getDistribIndicName("projected_facade_area_distribution", 'h', h_bot, h_up).toString().toUpperCase() + for (int d = 0; d < parameters.facadeDensNumberOfDirection / 2; d++) { + int d_bot = d * 360 / parameters.facadeDensNumberOfDirection + int d_up = d_bot + rangeDeg + listFacadeDistrib.add(Geoindicators.RsuIndicators.getDistribIndicName(name_h, 'd', d_bot, d_up).toString().toUpperCase()) + } + } + listNames = [ + "TEB" : ["VERT_ROOF_DENSITY", "NON_VERT_ROOF_DENSITY"] + + listRoadDir + listFacadeDistrib + listHeightDistrib + listBuildTypTeb + + ["EFFECTIVE_TERRAIN_ROUGHNESS_LENGTH"], + "UTRF": ["AREA", "ASPECT_RATIO", "BUILDING_TOTAL_FRACTION", "FREE_EXTERNAL_FACADE_DENSITY", + "VEGETATION_FRACTION_UTRF", "LOW_VEGETATION_FRACTION_UTRF", "HIGH_VEGETATION_IMPERVIOUS_FRACTION_UTRF", + "HIGH_VEGETATION_PERVIOUS_FRACTION_UTRF", "ROAD_FRACTION_UTRF", "IMPERVIOUS_FRACTION_UTRF", + "AVG_NUMBER_BUILDING_NEIGHBOR", "AVG_HEIGHT_ROOF_AREA_WEIGHTED", + "STD_HEIGHT_ROOF_AREA_WEIGHTED", "BUILDING_NUMBER_DENSITY", "BUILDING_VOLUME_DENSITY", + "BUILDING_VOLUME_DENSITY", "AVG_VOLUME", "GROUND_LINEAR_ROAD_DENSITY", + "GEOM_AVG_HEIGHT_ROOF", "BUILDING_FLOOR_AREA_DENSITY", + "AVG_MINIMUM_BUILDING_SPACING", "MAIN_BUILDING_DIRECTION", "BUILDING_DIRECTION_UNIQUENESS", + "BUILDING_DIRECTION_EQUALITY"], + "LCZ" : ["BUILDING_FRACTION_LCZ", "ASPECT_RATIO", "GROUND_SKY_VIEW_FACTOR", "PERVIOUS_FRACTION_LCZ", + "IMPERVIOUS_FRACTION_LCZ", "GEOM_AVG_HEIGHT_ROOF", "EFFECTIVE_TERRAIN_ROUGHNESS_LENGTH", "EFFECTIVE_TERRAIN_ROUGHNESS_CLASS", + "HIGH_VEGETATION_FRACTION_LCZ", "LOW_VEGETATION_FRACTION_LCZ", "WATER_FRACTION_LCZ"] + listBuildTypLcz] + + + // Basic columns at RSU scale + listColBasic = ["ID_RSU", "THE_GEOM"] + + // Indicators common to each indicator use + listColCommon = ["LOW_VEGETATION_FRACTION", "HIGH_VEGETATION_FRACTION", + "BUILDING_FRACTION", "WATER_FRACTION", "ROAD_FRACTION", "IMPERVIOUS_FRACTION", + "HIGH_VEGETATION_LOW_VEGETATION_FRACTION", "HIGH_VEGETATION_WATER_FRACTION", + "HIGH_VEGETATION_ROAD_FRACTION", "HIGH_VEGETATION_IMPERVIOUS_FRACTION", + "HIGH_VEGETATION_BUILDING_FRACTION", "UNDEFINED_FRACTION"] + + // Column names in the LCZ Table + listColLcz = ["LCZ_PRIMARY", "LCZ_SECONDARY", "LCZ_EQUALITY_VALUE", "LCZ_UNIQUENESS_VALUE", "MIN_DISTANCE"] + + // Indicator lists for urban typology use at building and block scales + listUrbTyp = + ["Bu": ["THE_GEOM", "ID_RSU", "ID_BUILD", "ID_BLOCK", "NB_LEV", "ZINDEX", "MAIN_USE", "TYPE", "ID_SOURCE", + "HEIGHT_ROOF", "HEIGHT_WALL", "PERIMETER", "AREA", "VOLUME", "FLOOR_AREA", "TOTAL_FACADE_LENGTH", "COMMON_WALL_FRACTION", + "CONTIGUITY", "AREA_CONCAVITY", "FORM_FACTOR", "RAW_COMPACTNESS", "PERIMETER_CONVEXITY", + "MINIMUM_BUILDING_SPACING", "NUMBER_BUILDING_NEIGHBOR", "ROAD_DISTANCE", "LIKELIHOOD_LARGE_BUILDING"], + "Bl": ["THE_GEOM", "ID_RSU", "ID_BLOCK", "AREA", "FLOOR_AREA", "VOLUME", "HOLE_AREA_DENSITY", "MAIN_BUILDING_DIRECTION", + "BUILDING_DIRECTION_UNIQUENESS", "BUILDING_DIRECTION_EQUALITY", "CLOSINGNESS", "NET_COMPACTNESS", + "AVG_HEIGHT_ROOF_AREA_WEIGHTED", "STD_HEIGHT_ROOF_AREA_WEIGHTED"]] + + } @Test void GeoIndicatorsTest1() { @@ -131,7 +181,7 @@ class WorkflowGeoIndicatorsTest { Map geoIndicatorsCompute_i = Geoindicators.WorkflowGeoIndicators.computeAllGeoIndicators(datasource, inputTableNames.zoneTable, inputTableNames.buildingTable, inputTableNames.roadTable, inputTableNames.railTable, inputTableNames.vegetationTable, - inputTableNames.hydrographicTable, "", "", "", "","", + inputTableNames.hydrographicTable, "", "", "", "", "", ["indicatorUse": indicatorUse, svfSimplified: false], prefixName) assertNotNull(geoIndicatorsCompute_i) checkRSUIndicators(datasource, geoIndicatorsCompute_i.rsu_indicators) @@ -139,10 +189,10 @@ class WorkflowGeoIndicatorsTest { assertEquals(listUrbTyp.Bl.sort(), datasource.getTable(geoIndicatorsCompute_i.block_indicators).columns.sort()) - def expectListRsuTempo = listColBasic + listColCommon + List expectListRsuTempo = listColBasic + listColCommon expectListRsuTempo = (expectListRsuTempo + indicatorUse.collect { listNames[it] }).flatten() - def expectListRsu = expectListRsuTempo.toUnique() - def realListRsu = datasource.getTable(geoIndicatorsCompute_i.rsu_indicators).columns + List expectListRsu = expectListRsuTempo.toUnique() + List realListRsu = datasource.getTable(geoIndicatorsCompute_i.rsu_indicators).columns // We test that there is no missing indicators in the RSU table for (i in expectListRsu) { assertTrue realListRsu.contains(i) @@ -161,6 +211,24 @@ class WorkflowGeoIndicatorsTest { dfBlock = dfBlock.drop("ID_RSU") assertEquals dfBlock.nrows(), dfBlock.omitNullRows().nrows() + // Test that the sum of all building fractions is 100% for both LCZ and TEB building types + if (listBuildTypTeb){ + def sum_afrac_teb = datasource.firstRow("SELECT AVG(${listBuildTypTeb.join("+")}) AS SUM_FRAC FROM ${"$geoIndicatorsCompute_i.rsu_indicators"} WHERE BUILDING_DIRECTION_UNIQUENESS <> -1") + assertEquals sum_afrac_teb.SUM_FRAC, 1.0, 0.01 + } + if (listBuildTypLcz){ + def sum_afrac_lcz = datasource.firstRow("SELECT AVG(${listBuildTypLcz.join("+")}) AS SUM_FRAC FROM ${"$geoIndicatorsCompute_i.rsu_indicators"} WHERE BUILDING_DIRECTION_UNIQUENESS <> -1") + assertEquals sum_afrac_lcz.SUM_FRAC, 1.0, 0.01 + } + if (listFloorBuildTypLcz){ + def sum_fafrac_lcz = datasource.firstRow("SELECT AVG(${listFloorBuildTypLcz.join("+")}) AS SUM_FRAC FROM ${"$geoIndicatorsCompute_i.rsu_indicators"} WHERE BUILDING_DIRECTION_UNIQUENESS <> -1") + assertEquals sum_fafrac_lcz.SUM_FRAC, 1.0, 0.01 + } + if (listFloorBuildTypTeb){ + def sum_fafrac_teb = datasource.firstRow("SELECT AVG(${listFloorBuildTypTeb.join("+")}) AS SUM_FRAC FROM ${"$geoIndicatorsCompute_i.rsu_indicators"} WHERE BUILDING_DIRECTION_UNIQUENESS <> -1") + assertEquals sum_fafrac_teb.SUM_FRAC, 1.0, 0.01 + } + } @Test @@ -174,7 +242,7 @@ class WorkflowGeoIndicatorsTest { inputTableNames.buildingTable, inputTableNames.roadTable, inputTableNames.railTable, inputTableNames.vegetationTable, inputTableNames.hydrographicTable, "", - "", "", "","", + "", "", "", "", ["indicatorUse": indicatorUse, svfSimplified: false, "utrfModelName": "UTRF_BDTOPO_V2_RF_2_2.model"], prefixName) assertNotNull(geoIndicatorsCompute_i) @@ -250,7 +318,7 @@ class WorkflowGeoIndicatorsTest { Map geoIndicatorsCompute_i = Geoindicators.WorkflowGeoIndicators.computeAllGeoIndicators(datasource, inputTableNames.zoneTable, inputTableNames.buildingTable, inputTableNames.roadTable, inputTableNames.railTable, inputTableNames.vegetationTable, - inputTableNames.hydrographicTable, "","", + inputTableNames.hydrographicTable, "", "", "", "", "", ["indicatorUse": indicatorUse, svfSimplified: false], prefixName) assertNotNull(geoIndicatorsCompute_i) @@ -266,6 +334,7 @@ class WorkflowGeoIndicatorsTest { def realListRsu = datasource.getTable(geoIndicatorsCompute_i.rsu_indicators).columns // We test that there is no missing indicators in the RSU table for (i in expectListRsu) { + println(i) assertTrue realListRsu.contains(i) } if (indicatorUse.contains("LCZ")) { @@ -292,7 +361,7 @@ class WorkflowGeoIndicatorsTest { inputTableNames.buildingTable, inputTableNames.roadTable, inputTableNames.railTable, inputTableNames.vegetationTable, inputTableNames.hydrographicTable, "", - "", "", "","", ["indicatorUse": indicatorUse, svfSimplified: false], prefixName) + "", "", "", "", ["indicatorUse": indicatorUse, svfSimplified: false], prefixName) assertNotNull(geoIndicatorsCompute_i) checkRSUIndicators(datasource, geoIndicatorsCompute_i.rsu_indicators) @@ -332,7 +401,7 @@ class WorkflowGeoIndicatorsTest { inputTableNames.buildingTable, inputTableNames.roadTable, inputTableNames.railTable, inputTableNames.vegetationTable, inputTableNames.hydrographicTable, "", - "", "", "", "",["indicatorUse": indicatorUse, svfSimplified: false], prefixName) + "", "", "", "", ["indicatorUse": indicatorUse, svfSimplified: false], prefixName) assertNotNull(geoIndicatorsCompute_i) checkRSUIndicators(datasource, geoIndicatorsCompute_i.rsu_indicators) @@ -374,7 +443,7 @@ class WorkflowGeoIndicatorsTest { inputTableNames.buildingTable, inputTableNames.roadTable, inputTableNames.railTable, inputTableNames.vegetationTable, inputTableNames.hydrographicTable, "", "", "", - "","", + "", "", ["indicatorUse": indicatorUse, "svfSimplified": false], prefixName) assertNotNull(geoIndicatorsCompute_i) @@ -416,7 +485,7 @@ class WorkflowGeoIndicatorsTest { inputTableNames.buildingTable, inputTableNames.roadTable, inputTableNames.railTable, inputTableNames.vegetationTable, inputTableNames.hydrographicTable, "", - "", "", "", "",["indicatorUse": indicatorUse, svfSimplified: false], prefixName) + "", "", "", "", ["indicatorUse": indicatorUse, svfSimplified: false], prefixName) assertNotNull(geoIndicatorsCompute_i) def expectListRsuTempo = listColBasic + listColCommon @@ -469,15 +538,15 @@ class WorkflowGeoIndicatorsTest { assertEquals(100d, rows.SUM_POP) assertEquals(10d, rows.AVG_HEIGHT_ROOF) assertEquals(0d, rows.STD_HEIGHT_ROOF) - assertTrue(10d-rows.GEOM_AVG_HEIGHT_ROOF< 0.0001) + assertTrue(10d - rows.GEOM_AVG_HEIGHT_ROOF < 0.0001) assertEquals(10d, rows.AVG_HEIGHT_ROOF_AREA_WEIGHTED) assertEquals(0d, rows.STD_HEIGHT_ROOF_AREA_WEIGHTED) assertEquals(2d, rows.FREE_EXTERNAL_FACADE_DENSITY) assertEquals(3d, rows.BUILDING_SURFACE_DENSITY) - assertTrue(1.5 -rows.EFFECTIVE_TERRAIN_ROUGHNESS_LENGTH<0.001) + assertTrue(1.5 - rows.EFFECTIVE_TERRAIN_ROUGHNESS_LENGTH < 0.001) assertEquals(8, rows.EFFECTIVE_TERRAIN_ROUGHNESS_CLASS) assertNull(rows.ASPECT_RATIO) - assertTrue(0.5 -rows.SVF<0.1) + assertTrue(0.5 - rows.SVF < 0.1) assertEquals(1d, rows.TYPE_OFFICE) } diff --git a/geoindicators/src/test/resources/org/orbisgis/geoclimate/geoindicators/data_for_tests.sql b/geoindicators/src/test/resources/org/orbisgis/geoclimate/geoindicators/data_for_tests.sql index 75c48f0ed7..be8f261054 100644 --- a/geoindicators/src/test/resources/org/orbisgis/geoclimate/geoindicators/data_for_tests.sql +++ b/geoindicators/src/test/resources/org/orbisgis/geoclimate/geoindicators/data_for_tests.sql @@ -29,9 +29,9 @@ CREATE TABLE rsu_test_all_indics_for_lcz(id_rsu int, sky_view_factor float, aspe IMPERVIOUS_FRACTION_LCZ float, PERVIOUS_FRACTION_LCZ float, GEOM_AVG_HEIGHT_ROOF float, EFFECTIVE_TERRAIN_ROUGHNESS_LENGTH float, HIGH_VEGETATION_FRACTION_LCZ float, LOW_VEGETATION_FRACTION_LCZ float, WATER_FRACTION_LCZ float, IMPERVIOUS_FRACTION float, - AREA_FRACTION_HEAVY_INDUSTRY float, AREA_FRACTION_COMMERCIAL float, - AREA_FRACTION_RESIDENTIAL float, AVG_NB_LEV_AREA_WEIGHTED float, - GROUND_SKY_VIEW_FACTOR float, AREA_FRACTION_LIGHT_INDUSTRY float); + AREA_FRACTION_HEAVY_INDUSTRY_LCZ float, AREA_FRACTION_COMMERCIAL_LCZ float, + AREA_FRACTION_RESIDENTIAL_LCZ float, AVG_NB_LEV_AREA_WEIGHTED float, + GROUND_SKY_VIEW_FACTOR float, AREA_FRACTION_LIGHT_INDUSTRY_LCZ float); INSERT INTO building_test VALUES (1, 1, 1, 0, 'POLYGON((4 4, 10 4, 10 30, 4 30, 4 4))'::GEOMETRY, 8, 8, 156, 64, 2, 64, 0, 0, 'industrial'), (2, 2, 1, 0, 'POLYGON((12 4, 20 4, 20 9, 12 9, 12 4))'::GEOMETRY, 10, 13, 40, 26, 3, 26, 0, 0, 'detached'), diff --git a/osm/src/main/groovy/org/orbisgis/geoclimate/osm/InputDataFormatting.groovy b/osm/src/main/groovy/org/orbisgis/geoclimate/osm/InputDataFormatting.groovy index 2f20b9e90a..00defea293 100644 --- a/osm/src/main/groovy/org/orbisgis/geoclimate/osm/InputDataFormatting.groovy +++ b/osm/src/main/groovy/org/orbisgis/geoclimate/osm/InputDataFormatting.groovy @@ -214,15 +214,20 @@ Map formatBuildingLayer(JdbcDataSource datasource, String building, String zone create table $buildinType as select MAX(part) FILTER (WHERE type = 'residential') as "residential", MAX(part) FILTER (WHERE type = 'education') as "education", + MAX(part) FILTER (WHERE type = 'school') as "school", + MAX(part) FILTER (WHERE type = 'university') as "university", + MAX(part) FILTER (WHERE type = 'research_institute') as "research_institute", + MAX(part) FILTER (WHERE type = 'construction') as "construction", MAX(part) FILTER (WHERE type = 'commercial') as "commercial", - MAX(part) FILTER (WHERE type = 'heavy_industry') as "heavy_industry", - MAX(part) FILTER (WHERE type = 'light_industry') as "light_industry", + MAX(part) FILTER (WHERE type = 'retail') as "retail", + MAX(part) FILTER (WHERE type = 'industrial') as "industrial", + MAX(part) FILTER (WHERE type = 'port') as "port", + MAX(part) FILTER (WHERE type = 'refinery') as "refinery", MAX(part) FILTER (WHERE type = 'government') as "government", + MAX(part) FILTER (WHERE type = 'community_centre') as "community_centre", MAX(part) FILTER (WHERE type = 'military') as "military", - MAX(part) FILTER (WHERE type = 'transport') as "transport", - MAX(part) FILTER (WHERE type = 'construction') as "construction", - MAX(part) FILTER (WHERE type = 'agricultural') as "agricultural", - MAX(part) FILTER (WHERE type = 'social_building') as "social_building", + MAX(part) FILTER (WHERE type = 'railway') as "railway", + MAX(part) FILTER (WHERE type = 'farmyard') as "farmyard", id_build FROM $urbanAreasPart where part > 0.9 group by id_build """.toString() datasource.withBatch(100) { stmt -> diff --git a/osm/src/main/resources/org/orbisgis/geoclimate/osm/buildingParams.json b/osm/src/main/resources/org/orbisgis/geoclimate/osm/buildingParams.json index d392a7af30..e01bcb995a 100644 --- a/osm/src/main/resources/org/orbisgis/geoclimate/osm/buildingParams.json +++ b/osm/src/main/resources/org/orbisgis/geoclimate/osm/buildingParams.json @@ -50,7 +50,7 @@ "historic": 0, "monument": 0, "ruins": 0, - "castle": 0, + "castle": 1, "agricultural": 0, "farm": 0, "farm_auxiliary": 0, @@ -67,6 +67,7 @@ "toll_booth": 0, "toll": 0, "terminal": 0, + "airport_terminal": 0, "healthcare": 1, "education": 1, "entertainment_arts_culture": 0, @@ -78,28 +79,132 @@ "government": 1, "townhall": 1, "office": 1, - "heavy_industry": 0, - "light_industry": 0, "emergency": 0, "hotel": 2, "hospital": 2, "parking": 1, "slight_construction": 0, - "water_tower" : 0 + "water_tower" : 0, + "fortress": 0, + "abbey": 0, + "cathedral": 0, + "mosque": 0, + "musalla": 0, + "temple": 0, + "synagogue": 0, + "shrine": 0, + "place_of_worship": 0, + "wayside_shrine": 0, + "swimming_pool" : 0, + "fitness_centre": 1, + "horse_riding": 0, + "ice_rink" : 0, + "pitch": 0, + "stadium": 0, + "track": 0, + "sports_hall": 0, + "ammunition": 0, + "bunker": 0, + "barracks": 1, + "casemate": 0, + "station": 0, + "government_office": 1, + "stable": 0, + "sty": 0, + "cowshed": 0, + "digester": 0, + "farmhouse": 0, + "bank": 1, + "bureau_de_change": 0, + "boat_rental": 0, + "car_rental" : 0, + "internet_cafe": 0, + "kiosk": 0, + "money_transfer": 0, + "market": 0, + "marketplace": 0, + "pharmacy" : 0, + "post_office" : 1, + "retail": 0, + "shop" : 0, + "store": 0, + "supermarket": 0, + "warehouse": 0, + "factory": 0, + "gas" : 0, + "heating_station": 0, + "oil_mill" : 0, + "oil": 0, + "wellsite": 0, + "well_cluster": 0, + "grain_silo": 0, + "villa": 1, + "dormitory": 1, + "condominium": 1, + "sheltered_housing": 0, + "workers_dormitory" :0, + "terrace": 1, + "transportation": 0, + "hangar": 0, + "tower": 1, + "control_tower": 0, + "aeroway": 1, + "roundhouse": 0, + "social_facility": 1, + "college": 1, + "kindergarten": 0, + "school": 0, + "university": 1, + "cinema": 1, + "arts_centre": 0, + "brothel": 1, + "casino": 0, + "community_centre": 0, + "conference_centre": 1, + "events_venue": 1, + "exhibition_centre": 0, + "gambling": 0, + "music_venue": 0, + "nightclub": 0, + "planetarium": 0, + "social_centre": 0, + "studio": 0, + "theatre": 0, + "library": 1, + "museum": 0, + "aquarium": 0, + "gallery": 0, + "information": 0, + "restaurant": 0, + "bar": 0, + "cafe": 0, + "fast_food": 0, + "ice_cream": 0, + "pub": 0, + "attraction": 0, + "refinery": 0 }, "type": { "terminal:transport": { "aeroway": [ - "terminal", - "airport_terminal" + "terminal" + ], + "amenity": [ + "terminal" + ], + "building": [ + "terminal" + ] + }, + "airport_terminal:transport": { + "aeroway": [ + "terminal" ], "amenity": [ - "terminal", - "airport_terminal" + "terminal" ], "building": [ - "terminal", - "airport_terminal" + "terminal" ] }, "parking:transport": { @@ -107,6 +212,84 @@ "parking" ] }, + "train_station:transport": { + "building": [ + "train_station" + ], + "railway": [ + "train_station" + ], + "public_transport": [ + "train_station" + ], + "amenity": [ + "train_station" + ] + }, + "station:transport": { + "railway": [ + "station" + ] + }, + "toll:transport": { + "barrier": [ + "toll_booth" + ], + "building": [ + "toll_booth" + ] + }, + "shelter:transport": { + "shelter_type": [ + "public_transport" + ] + }, + "transportation:transport": { + "building": [ + "transportation" + ] + }, + "station:transport": { + "building": [ + "station" + ], + "railway": [ + "station" + ], + "public_transport": [ + "station" + ] + }, + "hangar:transport": { + "aeroway": [ + "hangar" + ] + }, + "tower:transport": { + "aeroway": [ + "tower" + ] + }, + "bunker:transport": { + "aeroway": [ + "bunker" + ] + }, + "control_tower:transport": { + "aeroway": [ + "control_tower" + ] + }, + "aeroway:transport": { + "aeroway": [ + "building" + ] + }, + "roundhouse:transport": { + "railway": [ + "roundhouse" + ] + }, "monument": { "building": [ "monument" @@ -145,519 +328,981 @@ }, "castle:heritage": { "building": [ - "castle", + "castle" + ] + }, + "fortress:heritage": { + "building": [ "fortress" ] }, - "religious": { + "religious:religious": { "building": [ - "religious", - "abbey", - "cathedral", - "mosque", - "musalla", - "temple", - "synagogue", - "shrine", - "place_of_worship", - "wayside_shrine" + "religious" ], "amenity": [ - "religious", - "abbey", - "cathedral", - "chapel", - "church", - "mosque", - "musalla", - "temple", - "synagogue", - "shrine", - "place_of_worship", - "wayside_shrine" - ], - "place_of_worship": [ - "! no", - "! chapel", - "! church" + "religious" ] }, - "sport:sport": { + "abbey:religious": { "building": [ - "swimming_pool", - "fitness_centre", - "horse_riding", - "ice_rink", - "pitch", - "stadium", - "track" - ], - "leisure": [ - "swimming_pool", - "fitness_centre", - "horse_riding", - "ice_rink", - "pitch", - "stadium", - "track" + "abbey" ], "amenity": [ - "swimming_pool", - "fitness_centre", - "horse_riding", - "ice_rink", - "pitch", - "stadium", - "track" + "abbey" ] }, - "sports_centre:sport": { + "cathedral:religious": { "building": [ - "sports_centre", - "sports_hall" - ], - "leisure": [ - "sports_centre", - "sports_hall" + "cathedral" ], "amenity": [ - "sports_centre", - "sports_hall" + "cathedral" ] }, - "military": { - "military": [ - "ammunition", - "bunker", - "barracks", - "casemate", - "office", - "shelter" - ], + "mosque:religious": { "building": [ - "ammunition", - "bunker", - "barracks", - "casemate", - "military", - "shelter" + "mosque" ], - "office": [ - "military" + "amenity": [ + "mosque" ] }, - "train_station:transport": { + "musalla:religious": { "building": [ - "train_station" - ], - "railway": [ - "station", - "train_station" - ], - "public_transport": [ - "train_station" + "musalla" ], "amenity": [ - "train_station" + "musalla" ] }, - "townhall:government": { - "amenity": [ - "townhall" - ], + "temple:religious": { "building": [ - "townhall" - ] - }, - "toll:transport": { - "barrier": [ - "toll_booth" + "temple" ], - "building": [ - "toll_booth" + "amenity": [ + "temple" ] }, - "government": { + "synagogue:religious": { "building": [ - "government", - "government_office" - ], - "government": [ - "! no" + "synagogue" ], - "office": [ - "government" + "amenity": [ + "synagogue" ] }, - "historic": { + "shrine:religious": { "building": [ - "historic" + "shrine" ], - "historic": [ - ], - "historic_building": [ - "! no" + "amenity": [ + "shrine" ] }, - "grandstand:entertainment_arts_culture": { + "place_of_worship:religious": { "building": [ - "grandstand" - ], - "leisure": [ - "grandstand" + "place_of_worship" ], "amenity": [ - "grandstand" - ], - "grandstand": [ - "yes" + "place_of_worship" ] }, - "detached:residential": { + "wayside_shrine:religious": { "building": [ - "detached" + "wayside_shrine" ], - "house": [ - "detached" + "amenity": [ + "wayside_shrine" ] }, - "farm_auxiliary:agricultural": { + "swimming_pool:sport": { "building": [ - "farm_auxiliary", - "barn", - "stable", - "sty", - "cowshed", - "digester", - "greenhouse" - ] - }, - "commercial": { - "building": [ - "bank", - "bureau_de_change", - "boat_rental", - "car_rental", - "commercial", - "internet_cafe", - "kiosk", - "money_transfer", - "market", - "marketplace", - "pharmacy", - "post_office", - "retail", - "shop", - "store", - "supermarket", - "warehouse" + "swimming_pool" ], - "amenity": [ - "bank", - "bureau_de_change", - "boat_rental", - "car_rental", - "commercial", - "internet_cafe", - "kiosk", - "money_transfer", - "market", - "market_place", - "pharmacy", - "post_office", - "retail", - "shop", - "store", - "supermarket", - "warehouse" + "leisure": [ + "swimming_pool" ], - "shop": [ - "!= no" + "amenity": [ + "swimming_pool" ] }, - "light_industry:industrial": { + "fitness_centre:sport": { "building": [ - "industrial", - "factory", - "warehouse" + "fitness_centre" ], - "industrial": [ - "factory" + "leisure": [ + "fitness_centre" ], "amenity": [ - "factory" + "fitness_centre" ] }, - "heavy_industry:industrial": { + "horse_riding:sport": { "building": [ - "digester" + "horse_riding" ], - "industrial": [ - "gas", - "heating_station", - "oil_mill", - "oil", - "wellsite", - "well_cluster" + "leisure": [ + "horse_riding" + ], + "amenity": [ + "horse_riding" ] }, - "greenhouse:agricultural": { + "ice_rink:sport": { "building": [ - "greenhouse" + "ice_rink" ], - "amenity": [ - "greenhouse" + "leisure": [ + "ice_rink" ], - "industrial": [ - "greenhouse" + "amenity": [ + "ice_rink" ] }, - "silo:agricultural": { + "pitch:sport": { "building": [ - "silo", - "grain_silo" + "pitch" ], - "man_made": [ - "silo", - "grain_silo" + "leisure": [ + "pitch" + ], + "amenity": [ + "pitch" ] }, - "house:residential": { + "stadium:sport": { "building": [ - "house" + "stadium" ], - "house": [ - "! no", - "! detached", - "! residential", - "! villa", - "residential" + "leisure": [ + "stadium" ], "amenity": [ - "house" + "stadium" ] }, - "apartments:residential": { + "track:sport": { "building": [ - "apartments" + "track" ], - "residential": [ - "apartments" + "leisure": [ + "track" ], "amenity": [ - "apartments" - ], - "apartments": [ - "yes" + "track" ] }, - "bungalow:residential": { + "sports_centre:sport": { "building": [ - "bungalow" + "sports_centre" ], - "house": [ - "bungalow" + "leisure": [ + "sports_centre" ], "amenity": [ - "bungalow" + "sports_centre" ] }, - "residential": { + "sports_hall:sport": { "building": [ - "residential", - "villa", - "dormitory", - "condominium", - "sheltered_housing", - "workers_dormitory", - "terrace" - ], - "residential": [ - "university", - "detached", - "dormitory", - "condominium", - "sheltered_housing", - "workers_dormitory", - "building" + "sports_hall" ], - "house": [ - "residential" + "leisure": [ + "sports_hall" ], "amenity": [ - "residential" + "sports_hall" ] }, - "ruins:heritage": { - "building": [ - "ruins" + "ammunition:military": { + "military": [ + "ammunition" ], - "ruins": [ - "ruins" + "building": [ + "ammunition" ] }, - "agricultural": { - "building": [ - "agricultural" + "bunker:military": { + "military": [ + "bunker" ], - "agricultural": [ - "building" + "building": [ + "bunker" ] }, - "farm:agricultural": { + "barracks:military": { + "military": [ + "barracks" + ], "building": [ - "farm", - "farmhouse" + "barracks" ] }, - "barn:agricultural": { - "building": [ - "barn" + "casemate:military": { + "military": [ + "casemate" ], - "barn": [ - "! no" + "building": [ + "casemate" ] }, - "shelter": { - "amenity": [ + "casemate:military": { + "military": [ + "office" + ] + }, + "shelter:military": { + "military": [ "shelter" ] }, - "shelter:transport": { - "shelter_type": [ - "public_transport" + "office:military": { + "military": [ + "office" + ] + }, + "office:military": { + "military": [ + "office" + ], + "office": [ + "military" + ] + }, + "military:military": { + "building": [ + "military" + ] + }, + "townhall:government": { + "amenity": [ + "townhall" + ], + "building": [ + "townhall" + ] + }, + "government:government": { + "building": [ + "government" + ] + }, + "government_office:government": { + "building": [ + "government_office" + ], + "office": [ + "government" + ] + }, + "government:government": { + "building": [ + "public" + ] + }, + "historic": { + "building": [ + "historic" + ], + "historic": [ + ], + "historic_building": [ + "! no" + ] + }, + "grandstand:entertainment_arts_culture": { + "building": [ + "grandstand" + ], + "leisure": [ + "grandstand" + ], + "amenity": [ + "grandstand" + ], + "grandstand": [ + "yes" + ] + }, + "farm_auxiliary:agricultural": { + "building": [ + "farm_auxiliary" + ] + }, + "barn:agricultural": { + "building": [ + "barn" + ] + }, + "stable:agricultural": { + "building": [ + "stable" + ] + }, + "sty:agricultural": { + "building": [ + "sty" + ] + }, + "cowshed:agricultural": { + "building": [ + "cowshed" + ] + }, + "greenhouse:agricultural": { + "building": [ + "greenhouse" + ], + "amenity": [ + "greenhouse" + ], + "industrial": [ + "greenhouse" + ] + }, + "agricultural:agricultural": { + "building": [ + "agricultural" + ], + "agricultural": [ + "building" + ] + }, + "farm:agricultural": { + "building": [ + "farm" + ] + }, + "farmhouse:agricultural": { + "building": [ + "farmhouse" + ] + }, + "grain_silo:agricultural": { + "building": [ + "grain_silo" + ], + "man_made": [ + "grain_silo" + ] + }, + "silo:agricultural": { + "building": [ + "silo" + ], + "man_made": [ + "silo" + ] + }, + "bank:commercial": { + "building": [ + "bank" + ], + "amenity": [ + "bank" + ] + }, + "bureau_de_change:commercial": { + "building": [ + "bureau_de_change" + ], + "amenity": [ + "bureau_de_change" + ] + }, + "boat_rental:commercial": { + "building": [ + "boat_rental" + ], + "amenity": [ + "boat_rental" + ] + }, + "car_rental:commercial": { + "building": [ + "car_rental" + ], + "amenity": [ + "car_rental" + ] + }, + "commercial:commercial": { + "building": [ + "commercial" + ], + "amenity": [ + "commercial" + ] + }, + "internet_cafe:commercial": { + "building": [ + "internet_cafe" + ], + "amenity": [ + "internet_cafe" + ] + }, + "kiosk:commercial": { + "building": [ + "kiosk" + ], + "amenity": [ + "kiosk" + ] + }, + "money_transfer:commercial": { + "building": [ + "money_transfer" + ], + "amenity": [ + "money_transfer" + ] + }, + "market:commercial": { + "building": [ + "market" + ], + "amenity": [ + "market" + ] + }, + "marketplace:commercial": { + "building": [ + "marketplace" + ], + "amenity": [ + "marketplace" + ] + }, + "pharmacy:commercial": { + "building": [ + "pharmacy" + ], + "amenity": [ + "pharmacy" + ] + }, + "post_office:commercial": { + "building": [ + "post_office" + ], + "amenity": [ + "post_office" + ] + }, + "retail:commercial": { + "building": [ + "retail" + ], + "amenity": [ + "retail" + ] + }, + "shop:commercial": { + "building": [ + "shop" + ], + "amenity": [ + "shop" + ] + }, + "store:commercial": { + "building": [ + "store" + ], + "amenity": [ + "store" + ] + }, + "supermarket:commercial": { + "building": [ + "supermarket" + ], + "amenity": [ + "supermarket" + ] + }, + "warehouse:commercial": { + "building": [ + "warehouse" + ], + "amenity": [ + "warehouse" + ] + }, + "restaurant:commercial": { + "amenity": [ + "restaurant" + ], + "building": [ + "restaurant" + ], + "shop": [ + "restaurant" + ] + }, + "bar:commercial": { + "amenity": [ + "bar" + ], + "building": [ + "bar" + ], + "shop": [ + "bar" + ] + }, + "cafe:commercial": { + "amenity": [ + "cafe" + ], + "building": [ + "cafe" + ], + "shop": [ + "cafe" + ] + }, + "fast_food:commercial": { + "amenity": [ + "fast_food" + ], + "building": [ + "fast_food" + ], + "shop": [ + "fast_food" + ] + }, + "ice_cream:commercial": { + "amenity": [ + "ice_cream" + ], + "building": [ + "ice_cream" + ], + "shop": [ + "ice_cream" + ] + }, + "pub:commercial": { + "amenity": [ + "pub" + ], + "building": [ + "pub" + ], + "shop": [ + "pub" + ] + }, + "industrial:industrial": { + "building": [ + "industrial" + ] + }, + "factory:industrial": { + "building": [ + "factory" + ], + "industrial": [ + "factory" + ], + "amenity": [ + "factory" + ] + }, + "warehouse:industrial": { + "industrial": [ + "warehouse" + ] + }, + "digester:industrial": { + "building": [ + "digester" + ] + }, + "gas:industrial": { + "industrial": [ + "gas" + ] + }, + "heating_station:industrial": { + "industrial": [ + "heating_station" + ] + }, + "oil_mill:industrial": { + "industrial": [ + "oil_mill" + ] + }, + "oil:industrial": { + "industrial": [ + "oil" + ] + }, + "wellsite:industrial": { + "industrial": [ + "wellsite" + ] + }, + "well_cluster:industrial": { + "industrial": [ + "well_cluster" + ] + }, + "refinery:industrial": { + "industrial": [ + "refinery" ] }, - "transport": { + "house:residential": { "building": [ - "train_station", - "transportation", - "station" + "house" ], - "aeroway": [ - "hangar", - "tower", - "bunker", - "control_tower", + "house": [ + "residential" + ], + "amenity": [ + "house" + ] + }, + "detached:residential": { + "building": [ + "detached" + ], + "house": [ + "detached" + ] + }, + "apartments:residential": { + "building": [ + "apartments" + ], + "residential": [ + "apartments" + ], + "amenity": [ + "apartments" + ], + "apartments": [ + "yes" + ] + }, + "bungalow:residential": { + "building": [ + "bungalow" + ], + "house": [ + "bungalow" + ], + "amenity": [ + "bungalow" + ] + }, + "residential:residential": { + "building": [ + "residential" + ], + "residential": [ "building" ], - "railway": [ - "station", - "train_station", - "roundhouse" - + "amenity": [ + "residential" + ] + }, + "villa:residential": { + "building": [ + "villa" + ] + }, + "dormitory:residential": { + "building": [ + "dormitory" ], - "public_transport": [ - "train_station", - "station" + "residential": [ + "dormitory" + ] + }, + "condominium:residential": { + "building": [ + "condominium" + ], + "residential": [ + "condominium" + ] + }, + "sheltered_housing:residential": { + "building": [ + "sheltered_housing" + ], + "residential": [ + "sheltered_housing" + ] + }, + "workers_dormitory:residential": { + "building": [ + "workers_dormitory" + ], + "residential": [ + "workers_dormitory" + ] + }, + "terrace:residential": { + "building": [ + "terrace" + ], + "residential": [ + "terrace" + ] + }, + "ruins:heritage": { + "building": [ + "ruins" ], + "ruins": [ + "ruins" + ] + }, + "shelter:shelter": { "amenity": [ - "train_station", - "terminal" + "shelter" ] }, - "healthcare": { + "healthcare:healthcare": { "amenity": [ - "healthcare", - "social_facility" + "healthcare" ], "building": [ - "healthcare", + "healthcare" + ] + }, + "social_facility:healthcare": { + "amenity": [ + "social_facility" + ] + }, + "hospital:healthcare": { + "building": [ "hospital" + ] + }, + "education:education": { + "amenity": [ + "education" ], - "healthcare": [ - "! no" + "building": [ + "education" ] }, - "education": { + "college:education": { "amenity": [ - "education", - "college", - "kindergarten", - "school", - "university", - "research_institute" + "college" + ], + "building": [ + "college" + ], + "education": [ + "college" + ] + }, + "kindergarten:education": { + "amenity": [ + "kindergarten" + ], + "building": [ + "kindergarten" + ], + "education": [ + "kindergarten" + ] + }, + "school:education": { + "amenity": [ + "school" + ], + "building": [ + "school" + ], + "education": [ + "school" + ] + }, + "university:education": { + "amenity": [ + "university" ], "building": [ - "education", - "college", - "kindergarten", - "school", "university" ], "education": [ - "college", - "kindergarten", - "school", "university" ] }, - "entertainment_arts_culture": { - "leisure": [ - "! no" - ], "amenity": [ - "cinema","arts_centre", "brothel", "casino", - "community_centre", "conference_centre", - "events_venue", "exhibition_centre", "gambling", - "music_venue", "nightclub", "planetarium", - "social_centre","studio", "theatre", "library" - ], - "building": [ - "cinema","arts_centre", "brothel", "casino", - "community_centre", "conference_centre", - "events_venue", "exhibition_centre", "gambling", - "music_venue", "nightclub", "planetarium", - "social_centre","studio", "theatre" - ], "tourism": [ - "museum", "aquarium", "gallery", "information" - ] - }, - "sustenance:commercial": { - "amenity": [ - "restaurant", - "bar", - "cafe", - "fast_food", - "ice_cream", - "pub" + "research_institute:education": { + "amenity": [ + "research_institute" ], "building": [ - "restaurant", - "bar", - "cafe", - "fast_food", - "ice_cream", - "pub" + "research_institute" + ] + }, + "cinema:entertainment_arts_culture": { + "amenity": [ + "cinema" ], - "restaurant": [ - "! no" + "building": [ + "cinema" + ] + }, + "arts_centre:entertainment_arts_culture": { + "amenity": [ + "arts_centre" ], - "shop": [ - "restaurant", - "bar", - "cafe", - "fast_food", - "ice_cream", - "pub" + "building": [ + "arts_centre" + ] + }, + "brothel:entertainment_arts_culture": { + "amenity": [ + "brothel" ], - "sustenance": [ - "! no" + "building": [ + "brothel" ] }, - "office": { + "casino:entertainment_arts_culture": { + "amenity": [ + "casino" + ], "building": [ - "office" + "casino" + ] + }, + "community_centre:entertainment_arts_culture": { + "amenity": [ + "community_centre" ], + "building": [ + "community_centre" + ] + }, + "conference_centre:entertainment_arts_culture": { "amenity": [ - "office" + "conference_centre" ], - "office": [ - "! no" + "building": [ + "conference_centre" ] }, - "government:public": { + "events_venue:entertainment_arts_culture": { + "amenity": [ + "events_venue" + ], "building": [ - "public" + "events_venue" + ] + }, + "exhibition_centre:entertainment_arts_culture": { + "amenity": [ + "exhibition_centre" + ], + "building": [ + "exhibition_centre" + ] + }, + "gambling:entertainment_arts_culture": { + "amenity": [ + "gambling" + ], + "building": [ + "gambling" + ] + }, + "music_venue:entertainment_arts_culture": { + "amenity": [ + "music_venue" + ], + "building": [ + "music_venue" + ] + }, + "nightclub:entertainment_arts_culture": { + "amenity": [ + "nightclub" + ], + "building": [ + "nightclub" + ] + }, + "planetarium:entertainment_arts_culture": { + "amenity": [ + "planetarium" + ], + "building": [ + "planetarium" + ] + }, + "social_centre:entertainment_arts_culture": { + "amenity": [ + "social_centre" + ], + "building": [ + "social_centre" + ] + }, + "studio:entertainment_arts_culture": { + "amenity": [ + "studio" + ], + "building": [ + "studio" + ] + }, + "theatre:entertainment_arts_culture": { + "amenity": [ + "theatre" + ], + "building": [ + "theatre" + ] + }, + "library:entertainment_arts_culture": { + "amenity": [ + "library" + ], + "building": [ + "library" + ] + }, + "museum:entertainment_arts_culture": { + "tourism": [ + "museum" + ] + }, + "aquarium:entertainment_arts_culture": { + "tourism": [ + "aquarium" + ] + }, + "gallery:entertainment_arts_culture": { + "tourism": [ + "gallery" + ] + }, + "information:entertainment_arts_culture": { + "tourism": [ + "information" + ] + }, + "office": { + "building": [ + "office" + ], + "amenity": [ + "office" ] }, "emergency": { diff --git a/osm/src/main/resources/org/orbisgis/geoclimate/osm/urbanAreasParams.json b/osm/src/main/resources/org/orbisgis/geoclimate/osm/urbanAreasParams.json index bb1fae88a6..bbe53ac353 100644 --- a/osm/src/main/resources/org/orbisgis/geoclimate/osm/urbanAreasParams.json +++ b/osm/src/main/resources/org/orbisgis/geoclimate/osm/urbanAreasParams.json @@ -22,13 +22,23 @@ "education": { "landuse": [ "education" - ], + ] + }, + "university": { + "amenity": [ + "university" + ] + }, + "research_institute": { "amenity": [ - "school", - "university", "research_institute" ] }, + "school": { + "amenity": [ + "school" + ] + }, "construction": { "landuse": [ "construction" @@ -36,7 +46,11 @@ }, "commercial": { "landuse": [ - "commercial", + "commercial" + ] + }, + "retail": { + "landuse": [ "retail" ] }, @@ -45,14 +59,19 @@ "residential" ] }, - "heavy_industry": { - "industrial": [ - "refinery" + "industrial": { + "landuse": [ + "industrial" ] }, - "light_industry": { + "port": { "landuse": [ - "industrial", "port" + "port" + ] + }, + "refinery": { + "industrial": [ + "refinery" ] }, "government": { @@ -60,21 +79,22 @@ "institutional" ] }, - "social_building": { - "amenity": [ - "community_centre" - ]}, + "community_centre": { + "amenity": [ + "community_centre" + ] + }, "military": { "landuse": [ "military" ] }, - "transport": { + "railway": { "landuse": [ "railway" ] }, - "agricultural": { + "farmyard": { "landuse": [ "farmyard" ] diff --git a/osm/src/test/groovy/org/orbisgis/geoclimate/osm/InputDataFormattingTest.groovy b/osm/src/test/groovy/org/orbisgis/geoclimate/osm/InputDataFormattingTest.groovy index 3e67d9631b..ec03c9f90e 100644 --- a/osm/src/test/groovy/org/orbisgis/geoclimate/osm/InputDataFormattingTest.groovy +++ b/osm/src/test/groovy/org/orbisgis/geoclimate/osm/InputDataFormattingTest.groovy @@ -95,8 +95,9 @@ class InputDataFormattingTest { assertTrue(rows.type == ['residential', 'residential']) rows = h2GIS.rows("select type from ${buiding_imp} where id_build=881 or id_build=484 or id_build=610".toString()) + assertEquals(3, rows.size()) - assertTrue(rows.type == ['light_industry', 'light_industry', 'light_industry']) + assertTrue(rows.type == ['industrial', 'industrial', 'industrial']) //Roads