From 5f9d4e4cc914f10c6cfd3ee06405f18b880ba82d Mon Sep 17 00:00:00 2001
From: Guilhem Moulin <guilhem@fripost.org>
Date: Fri, 6 Jun 2025 01:46:06 +0200
Subject: Add various nature value layers.

Including k-skog, but we leave that one alone for now as the script
lacks some logic to process raster files.
---
 schema.sql | 483 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 483 insertions(+)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index 573587d..53cf6dc 100644
--- a/schema.sql
+++ b/schema.sql
@@ -2795,6 +2795,261 @@ ALTER TABLE postgis."sks:UtfordAvverk_ogc_fid_seq" OWNER TO webmap_import;
 ALTER SEQUENCE postgis."sks:UtfordAvverk_ogc_fid_seq" OWNED BY postgis."sks:UtfordAvverk".ogc_fid;
 
 
+--
+-- Name: sks:atervatningsavtal; Type: TABLE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE TABLE postgis."sks:atervatningsavtal" (
+    ogc_fid bigint NOT NULL,
+    "Uuid" uuid NOT NULL,
+    "Beteckn" character varying(12) NOT NULL,
+    "ArendeAr" smallint NOT NULL,
+    "AvtalatDatum" date,
+    "Url" character varying(252),
+    wkb_geometry postgis.geometry(MultiPolygon,3006) NOT NULL
+);
+
+
+ALTER TABLE postgis."sks:atervatningsavtal" OWNER TO webmap_import;
+
+--
+-- Name: TABLE "sks:atervatningsavtal"; Type: COMMENT; Schema: postgis; Owner: webmap_import
+--
+
+COMMENT ON TABLE postgis."sks:atervatningsavtal" IS 'Återvätningsavtal';
+
+
+--
+-- Name: sks:atervatningsavtal_ogc_fid_seq; Type: SEQUENCE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE SEQUENCE postgis."sks:atervatningsavtal_ogc_fid_seq"
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE postgis."sks:atervatningsavtal_ogc_fid_seq" OWNER TO webmap_import;
+
+--
+-- Name: sks:atervatningsavtal_ogc_fid_seq; Type: SEQUENCE OWNED BY; Schema: postgis; Owner: webmap_import
+--
+
+ALTER SEQUENCE postgis."sks:atervatningsavtal_ogc_fid_seq" OWNED BY postgis."sks:atervatningsavtal".ogc_fid;
+
+
+--
+-- Name: sks:naturvarde; Type: TABLE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE TABLE postgis."sks:naturvarde" (
+    ogc_fid bigint NOT NULL,
+    "ObjectId" integer NOT NULL,
+    "Beteckn" character varying(12) NOT NULL,
+    "Objnamn" character varying(62),
+    "Datinv" date NOT NULL,
+    "Biotop1" character varying(62),
+    "Biotop2" character varying(62),
+    "Biotop3" character varying(62),
+    "Beskrivn1" character varying(62),
+    "Beskrivn2" character varying(62),
+    "Beskrivn3" character varying(62),
+    "Url" character varying(254) NOT NULL,
+    wkb_geometry postgis.geometry(MultiPolygon,3006) NOT NULL
+);
+
+
+ALTER TABLE postgis."sks:naturvarde" OWNER TO webmap_import;
+
+--
+-- Name: TABLE "sks:naturvarde"; Type: COMMENT; Schema: postgis; Owner: webmap_import
+--
+
+COMMENT ON TABLE postgis."sks:naturvarde" IS 'Objekt med naturvärden - Skogsstyrelsen';
+
+
+--
+-- Name: sks:naturvarde_ogc_fid_seq; Type: SEQUENCE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE SEQUENCE postgis."sks:naturvarde_ogc_fid_seq"
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE postgis."sks:naturvarde_ogc_fid_seq" OWNER TO webmap_import;
+
+--
+-- Name: sks:naturvarde_ogc_fid_seq; Type: SEQUENCE OWNED BY; Schema: postgis; Owner: webmap_import
+--
+
+ALTER SEQUENCE postgis."sks:naturvarde_ogc_fid_seq" OWNED BY postgis."sks:naturvarde".ogc_fid;
+
+
+--
+-- Name: sks:nyckelbiotop; Type: TABLE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE TABLE postgis."sks:nyckelbiotop" (
+    ogc_fid bigint NOT NULL,
+    "Beteckn" character varying(12) NOT NULL,
+    "Objnamn" character varying(62),
+    "Datinv" date NOT NULL,
+    "Biotop1" character varying(62),
+    "Biotop2" character varying(62),
+    "Biotop3" character varying(62),
+    "Beskrivn1" character varying(62),
+    "Beskrivn2" character varying(62),
+    "Beskrivn3" character varying(62),
+    "Beskrivn4" character varying(62),
+    "Beskrivn5" character varying(62),
+    "Beskrivn6" character varying(62),
+    "Beskrivn7" character varying(62),
+    "Beskrivn8" character varying(62),
+    "Url" character varying(254) NOT NULL,
+    wkb_geometry postgis.geometry(MultiPolygon,3006) NOT NULL
+);
+
+
+ALTER TABLE postgis."sks:nyckelbiotop" OWNER TO webmap_import;
+
+--
+-- Name: TABLE "sks:nyckelbiotop"; Type: COMMENT; Schema: postgis; Owner: webmap_import
+--
+
+COMMENT ON TABLE postgis."sks:nyckelbiotop" IS 'Nyckelbiotoper - Skogsstyrelsen';
+
+
+--
+-- Name: sks:nyckelbiotop_ogc_fid_seq; Type: SEQUENCE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE SEQUENCE postgis."sks:nyckelbiotop_ogc_fid_seq"
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE postgis."sks:nyckelbiotop_ogc_fid_seq" OWNER TO webmap_import;
+
+--
+-- Name: sks:nyckelbiotop_ogc_fid_seq; Type: SEQUENCE OWNED BY; Schema: postgis; Owner: webmap_import
+--
+
+ALTER SEQUENCE postgis."sks:nyckelbiotop_ogc_fid_seq" OWNED BY postgis."sks:nyckelbiotop".ogc_fid;
+
+
+--
+-- Name: sks:nyckelbiotop_storskogsbruk; Type: TABLE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE TABLE postgis."sks:nyckelbiotop_storskogsbruk" (
+    ogc_fid bigint NOT NULL,
+    objectid integer NOT NULL,
+    "Org" character varying(62) NOT NULL,
+    "InkomDatum" date NOT NULL,
+    "Url" character varying(254) NOT NULL,
+    wkb_geometry postgis.geometry(MultiPolygon,3006) NOT NULL
+);
+
+
+ALTER TABLE postgis."sks:nyckelbiotop_storskogsbruk" OWNER TO webmap_import;
+
+--
+-- Name: TABLE "sks:nyckelbiotop_storskogsbruk"; Type: COMMENT; Schema: postgis; Owner: webmap_import
+--
+
+COMMENT ON TABLE postgis."sks:nyckelbiotop_storskogsbruk" IS 'Nyckelbiotoper - storskogsbruket';
+
+
+--
+-- Name: sks:nyckelbiotop_storskogsbruk_ogc_fid_seq; Type: SEQUENCE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE SEQUENCE postgis."sks:nyckelbiotop_storskogsbruk_ogc_fid_seq"
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE postgis."sks:nyckelbiotop_storskogsbruk_ogc_fid_seq" OWNER TO webmap_import;
+
+--
+-- Name: sks:nyckelbiotop_storskogsbruk_ogc_fid_seq; Type: SEQUENCE OWNED BY; Schema: postgis; Owner: webmap_import
+--
+
+ALTER SEQUENCE postgis."sks:nyckelbiotop_storskogsbruk_ogc_fid_seq" OWNED BY postgis."sks:nyckelbiotop_storskogsbruk".ogc_fid;
+
+
+--
+-- Name: sks:sumpskog; Type: TABLE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE TABLE postgis."sks:sumpskog" (
+    ogc_fid bigint NOT NULL,
+    "OBJECTID" integer NOT NULL,
+    "Namn" character varying(62),
+    "Hydrtext" character varying(62),
+    "Tradtext" character varying(62) NOT NULL,
+    "Delklass" character varying(62),
+    "Klassu" character varying(62),
+    "Lovandel" character varying(62),
+    "Krontakn" character varying(62),
+    "Huggklas" character varying(62),
+    "Andelva" character varying(62),
+    "Ingrepp" character varying(62),
+    "Ingrpavv" character varying(62),
+    "Objnyck" character varying(62),
+    "Delnyck" character varying(62),
+    "Flygar" smallint,
+    "Faltdat" date,
+    "Invtekn" character varying(62) NOT NULL,
+    "Invdat" date NOT NULL,
+    "Ansvmynd" character varying(62) NOT NULL,
+    "Url" character varying(252) NOT NULL,
+    wkb_geometry postgis.geometry(MultiPolygon,3006) NOT NULL
+);
+
+
+ALTER TABLE postgis."sks:sumpskog" OWNER TO webmap_import;
+
+--
+-- Name: TABLE "sks:sumpskog"; Type: COMMENT; Schema: postgis; Owner: webmap_import
+--
+
+COMMENT ON TABLE postgis."sks:sumpskog" IS 'Sumpskogar';
+
+
+--
+-- Name: sks:sumpskog_ogc_fid_seq; Type: SEQUENCE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE SEQUENCE postgis."sks:sumpskog_ogc_fid_seq"
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE postgis."sks:sumpskog_ogc_fid_seq" OWNER TO webmap_import;
+
+--
+-- Name: sks:sumpskog_ogc_fid_seq; Type: SEQUENCE OWNED BY; Schema: postgis; Owner: webmap_import
+--
+
+ALTER SEQUENCE postgis."sks:sumpskog_ogc_fid_seq" OWNED BY postgis."sks:sumpskog".ogc_fid;
+
+
 --
 -- Name: svk:ledningar; Type: TABLE; Schema: postgis; Owner: webmap_import
 --
@@ -3563,6 +3818,41 @@ ALTER TABLE ONLY postgis."sks:AvverkAnm" ALTER COLUMN ogc_fid SET DEFAULT nextva
 ALTER TABLE ONLY postgis."sks:UtfordAvverk" ALTER COLUMN ogc_fid SET DEFAULT nextval('postgis."sks:UtfordAvverk_ogc_fid_seq"'::regclass);
 
 
+--
+-- Name: sks:atervatningsavtal ogc_fid; Type: DEFAULT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:atervatningsavtal" ALTER COLUMN ogc_fid SET DEFAULT nextval('postgis."sks:atervatningsavtal_ogc_fid_seq"'::regclass);
+
+
+--
+-- Name: sks:naturvarde ogc_fid; Type: DEFAULT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:naturvarde" ALTER COLUMN ogc_fid SET DEFAULT nextval('postgis."sks:naturvarde_ogc_fid_seq"'::regclass);
+
+
+--
+-- Name: sks:nyckelbiotop ogc_fid; Type: DEFAULT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:nyckelbiotop" ALTER COLUMN ogc_fid SET DEFAULT nextval('postgis."sks:nyckelbiotop_ogc_fid_seq"'::regclass);
+
+
+--
+-- Name: sks:nyckelbiotop_storskogsbruk ogc_fid; Type: DEFAULT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:nyckelbiotop_storskogsbruk" ALTER COLUMN ogc_fid SET DEFAULT nextval('postgis."sks:nyckelbiotop_storskogsbruk_ogc_fid_seq"'::regclass);
+
+
+--
+-- Name: sks:sumpskog ogc_fid; Type: DEFAULT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:sumpskog" ALTER COLUMN ogc_fid SET DEFAULT nextval('postgis."sks:sumpskog_ogc_fid_seq"'::regclass);
+
+
 --
 -- Name: svk:ledningar ogc_fid; Type: DEFAULT; Schema: postgis; Owner: webmap_import
 --
@@ -4531,6 +4821,94 @@ ALTER TABLE ONLY postgis."sks:UtfordAvverk"
     ADD CONSTRAINT "sks:UtfordAvverk_pkey" PRIMARY KEY (ogc_fid);
 
 
+--
+-- Name: sks:atervatningsavtal sks:atervatningsavtal_Uuid_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:atervatningsavtal"
+    ADD CONSTRAINT "sks:atervatningsavtal_Uuid_key" UNIQUE ("Uuid");
+
+
+--
+-- Name: sks:atervatningsavtal sks:atervatningsavtal_pkey; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:atervatningsavtal"
+    ADD CONSTRAINT "sks:atervatningsavtal_pkey" PRIMARY KEY (ogc_fid);
+
+
+--
+-- Name: sks:naturvarde sks:naturvarde_Beteckn_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:naturvarde"
+    ADD CONSTRAINT "sks:naturvarde_Beteckn_key" UNIQUE ("Beteckn");
+
+
+--
+-- Name: sks:naturvarde sks:naturvarde_ObjectId_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:naturvarde"
+    ADD CONSTRAINT "sks:naturvarde_ObjectId_key" UNIQUE ("ObjectId");
+
+
+--
+-- Name: sks:naturvarde sks:naturvarde_pkey; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:naturvarde"
+    ADD CONSTRAINT "sks:naturvarde_pkey" PRIMARY KEY (ogc_fid);
+
+
+--
+-- Name: sks:nyckelbiotop sks:nyckelbiotop_Beteckn_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:nyckelbiotop"
+    ADD CONSTRAINT "sks:nyckelbiotop_Beteckn_key" UNIQUE ("Beteckn");
+
+
+--
+-- Name: sks:nyckelbiotop sks:nyckelbiotop_pkey; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:nyckelbiotop"
+    ADD CONSTRAINT "sks:nyckelbiotop_pkey" PRIMARY KEY (ogc_fid);
+
+
+--
+-- Name: sks:nyckelbiotop_storskogsbruk sks:nyckelbiotop_storskogsbruk_objectid_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:nyckelbiotop_storskogsbruk"
+    ADD CONSTRAINT "sks:nyckelbiotop_storskogsbruk_objectid_key" UNIQUE (objectid);
+
+
+--
+-- Name: sks:nyckelbiotop_storskogsbruk sks:nyckelbiotop_storskogsbruk_pkey; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:nyckelbiotop_storskogsbruk"
+    ADD CONSTRAINT "sks:nyckelbiotop_storskogsbruk_pkey" PRIMARY KEY (ogc_fid);
+
+
+--
+-- Name: sks:sumpskog sks:sumpskog_OBJECTID_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:sumpskog"
+    ADD CONSTRAINT "sks:sumpskog_OBJECTID_key" UNIQUE ("OBJECTID");
+
+
+--
+-- Name: sks:sumpskog sks:sumpskog_pkey; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:sumpskog"
+    ADD CONSTRAINT "sks:sumpskog_pkey" PRIMARY KEY (ogc_fid);
+
+
 --
 -- Name: svk:ledningar svk:ledningar_pkey; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
 --
@@ -5012,6 +5390,41 @@ CREATE INDEX "sks:AvverkAnm_wkb_geometry_geom_idx" ON postgis."sks:AvverkAnm" US
 CREATE INDEX "sks:UtfordAvverk_wkb_geometry_geom_idx" ON postgis."sks:UtfordAvverk" USING gist (wkb_geometry);
 
 
+--
+-- Name: sks:atervatningsavtal_wkb_geometry_geom_idx; Type: INDEX; Schema: postgis; Owner: webmap_import
+--
+
+CREATE INDEX "sks:atervatningsavtal_wkb_geometry_geom_idx" ON postgis."sks:atervatningsavtal" USING gist (wkb_geometry);
+
+
+--
+-- Name: sks:naturvarde_wkb_geometry_geom_idx; Type: INDEX; Schema: postgis; Owner: webmap_import
+--
+
+CREATE INDEX "sks:naturvarde_wkb_geometry_geom_idx" ON postgis."sks:naturvarde" USING gist (wkb_geometry);
+
+
+--
+-- Name: sks:nyckelbiotop_storskogsbruk_wkb_geometry_geom_idx; Type: INDEX; Schema: postgis; Owner: webmap_import
+--
+
+CREATE INDEX "sks:nyckelbiotop_storskogsbruk_wkb_geometry_geom_idx" ON postgis."sks:nyckelbiotop_storskogsbruk" USING gist (wkb_geometry);
+
+
+--
+-- Name: sks:nyckelbiotop_wkb_geometry_geom_idx; Type: INDEX; Schema: postgis; Owner: webmap_import
+--
+
+CREATE INDEX "sks:nyckelbiotop_wkb_geometry_geom_idx" ON postgis."sks:nyckelbiotop" USING gist (wkb_geometry);
+
+
+--
+-- Name: sks:sumpskog_wkb_geometry_geom_idx; Type: INDEX; Schema: postgis; Owner: webmap_import
+--
+
+CREATE INDEX "sks:sumpskog_wkb_geometry_geom_idx" ON postgis."sks:sumpskog" USING gist (wkb_geometry);
+
+
 --
 -- Name: svk:ledningar_wkb_geometry_geom_idx; Type: INDEX; Schema: postgis; Owner: webmap_import
 --
@@ -5879,6 +6292,76 @@ GRANT SELECT ON TABLE postgis."sks:UtfordAvverk" TO webmap_guest;
 GRANT SELECT,USAGE ON SEQUENCE postgis."sks:UtfordAvverk_ogc_fid_seq" TO webmap_guest;
 
 
+--
+-- Name: TABLE "sks:atervatningsavtal"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT ON TABLE postgis."sks:atervatningsavtal" TO webmap_guest;
+
+
+--
+-- Name: SEQUENCE "sks:atervatningsavtal_ogc_fid_seq"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT,USAGE ON SEQUENCE postgis."sks:atervatningsavtal_ogc_fid_seq" TO webmap_guest;
+
+
+--
+-- Name: TABLE "sks:naturvarde"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT ON TABLE postgis."sks:naturvarde" TO webmap_guest;
+
+
+--
+-- Name: SEQUENCE "sks:naturvarde_ogc_fid_seq"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT,USAGE ON SEQUENCE postgis."sks:naturvarde_ogc_fid_seq" TO webmap_guest;
+
+
+--
+-- Name: TABLE "sks:nyckelbiotop"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT ON TABLE postgis."sks:nyckelbiotop" TO webmap_guest;
+
+
+--
+-- Name: SEQUENCE "sks:nyckelbiotop_ogc_fid_seq"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT,USAGE ON SEQUENCE postgis."sks:nyckelbiotop_ogc_fid_seq" TO webmap_guest;
+
+
+--
+-- Name: TABLE "sks:nyckelbiotop_storskogsbruk"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT ON TABLE postgis."sks:nyckelbiotop_storskogsbruk" TO webmap_guest;
+
+
+--
+-- Name: SEQUENCE "sks:nyckelbiotop_storskogsbruk_ogc_fid_seq"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT,USAGE ON SEQUENCE postgis."sks:nyckelbiotop_storskogsbruk_ogc_fid_seq" TO webmap_guest;
+
+
+--
+-- Name: TABLE "sks:sumpskog"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT ON TABLE postgis."sks:sumpskog" TO webmap_guest;
+
+
+--
+-- Name: SEQUENCE "sks:sumpskog_ogc_fid_seq"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT,USAGE ON SEQUENCE postgis."sks:sumpskog_ogc_fid_seq" TO webmap_guest;
+
+
 --
 -- Name: TABLE spatial_ref_sys; Type: ACL; Schema: postgis; Owner: postgres
 --
-- 
cgit v1.2.3

