Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify types #944

Merged
merged 15 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -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"]
ebocher marked this conversation as resolved.
Show resolved Hide resolved
]

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,28 +234,28 @@ 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
WHERE b.$ID_FIELD_RSU IS NULL;""".toString()

// 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,
null AS min_distance,
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;
Expand Down
Loading
Loading