From f28a55443414467eda9d08954b3c997857ce2537 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Sat, 17 Dec 2022 22:02:14 +0100 Subject: [PATCH] Adjust OSM-based synthetic geolocation fields for micro-regions Field: district_postcode_city_sensorid Format: District, Postcode City (#SensorID) Example: Regierungsbezirk Darmstadt, 60385 Frankfurt (#76777) Field: suburb_postcode_city_sensorid Format: Suburb, Postcode City (#SensorID) Example: Eckenheim, 60435 Frankfurt (#65567) --- luftdatenpumpe/target/rdbms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/luftdatenpumpe/target/rdbms.py b/luftdatenpumpe/target/rdbms.py index a33a517..26e95f0 100644 --- a/luftdatenpumpe/target/rdbms.py +++ b/luftdatenpumpe/target/rdbms.py @@ -350,8 +350,10 @@ def create_views(self): concat(concat_ws(', ', osm_state, osm_country), ' ', country_code_suffix) AS state_and_country, concat(concat_ws(', ', osm_city, osm_state, osm_country), ' ', country_code_suffix) AS city_and_state_and_country, - concat(concat_ws(', ', osm_state_district, osm_postcode, osm_city), ' ', sensor_id_suffix) + concat(osm_state_district, ', ', osm_postcode, ' ', osm_city, ' ', sensor_id_suffix) AS district_postcode_city_sensorid, + concat(osm_suburb, ', ', osm_postcode, ' ', osm_city, ' ', sensor_id_suffix) + AS suburb_postcode_city_sensorid, {self.render_fields(conditional_fields_stage2)} ABS(DATE_PART('day', sensor_last_date - now())) <= 7 AS is_active