diff --git a/lib/data/sql/export_spatial.sql b/lib/data/sql/export_spatial.sql index 762b2751..71dc8b6f 100644 --- a/lib/data/sql/export_spatial.sql +++ b/lib/data/sql/export_spatial.sql @@ -134,6 +134,17 @@ WITH altitudinal_zones_cantonal AS WHERE hs_code IS NOT NULL and geom is not null GROUP BY hs_code, hsue_code) UNION + (SELECT + ST_Union(geom) AS geom, + CASE hsue_code is null + WHEN TRUE THEN hs_code::text + ELSE hs_code::text || '(' || hsue_code::text || ')' + END AS code, + hs_code::text as code_style + FROM forest_types_tg + WHERE hs_code IS NOT NULL and geom is not null + GROUP BY hs_code, hsue_code) + UNION (SELECT ST_Union(geom) AS geom, CASE hsue_code is null diff --git a/lib/data/sql/import_data.sql b/lib/data/sql/import_data.sql index 6e3ae991..4a70f82c 100644 --- a/lib/data/sql/import_data.sql +++ b/lib/data/sql/import_data.sql @@ -1169,8 +1169,27 @@ SELECT CREATE TABLE "forest_types_tg" ( gid serial, "fid" numeric, + "OBJECTID_1" numeric, + "objectid" numeric, + "reviernr" numeric, + "standortei" numeric, + "befahrbark" numeric, + "text" varchar(254), + "laubholzan" numeric, + "g1" numeric, + "g2" numeric, + "typ" numeric, + "ndhant" numeric, + "ndh_2050" numeric, + "zusatz" varchar(254), + "wuechsigk" numeric, + "Shape_Area" numeric, "tgneu" varchar(50), - "nais" varchar(50) + "nais" varchar(50), + "Hoehenstufe" varchar(50), + "tahsue" varchar(50), + "hs_code" int4, + "hsue_code" int4 ); ALTER TABLE "forest_types_tg"