From 58ec5a4544f55c53921bd553633733d153910e7a Mon Sep 17 00:00:00 2001
From: Guilhem Moulin <guilhem@fripost.org>
Date: Wed, 19 Jun 2024 14:13:18 +0200
Subject: Add layer definitions for Vindbrukskollen layers.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Only the land-based ones for now.  Source:
https://www.energimyndigheten.se/energisystem-och-analys/elproduktion/vindkraft/vindbrukskollen/

  Layers:
    - https://ext-geodatakatalog.lansstyrelsen.se/GeodataKatalogen/srv/api/records/GetMetaDataById?id=ed5814b2-08bf-493a-a164-7819e1b590d6
      LST Vindbrukskollen landbaserade vindkraftverk
    - https://ext-geodatakatalog.lansstyrelsen.se/GeodataKatalogen/srv/api/records/GetMetaDataById?id=c816bd1e-bc6c-487f-a962-770f05f677b6
      LST Vindbrukskollen landbaserade projekteringsområden
    - https://ext-geodatakatalog.lansstyrelsen.se/GeodataKatalogen/srv/api/records/GetMetaDataById?id=c290bc31-1af8-497e-a9a5-87fcec55d0ce
      LST Vindbrukskollen havsbaserad vindkraft

  Webmaps:
    - https://vbk.lansstyrelsen.se/
    - https://ext-geodatakatalog.lansstyrelsen.se/GeodataKatalogen/srv/swe/catalog.search#/map
---
 schema.sql | 314 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 314 insertions(+)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index 6b4e773..f4f90df 100644
--- a/schema.sql
+++ b/schema.sql
@@ -638,6 +638,196 @@ 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: vbk:havsbaserad_vindkraft; Type: TABLE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE TABLE postgis."vbk:havsbaserad_vindkraft" (
+    ogc_fid bigint NOT NULL,
+    "OmrID" character(10) NOT NULL,
+    "Projektnamn" character varying(62),
+    "Organisationsnamn" character varying(254),
+    "Organisationsnummer" character(11),
+    "Projektstatus" character varying(62) NOT NULL,
+    "Diarienummer" character varying(254),
+    "AndringsansokanPagar" boolean,
+    "SamradsunderlagInlamnat" date,
+    "AnsokanInlamnat" date,
+    "AnsokanAterkallad" date,
+    "AnsokanBeviljad" date,
+    "AnsokanAvslagen" date,
+    "AnsokanOverklagad" date,
+    "Natura2000_Ansokan" character varying(62) NOT NULL,
+    "Natura2000_Beslutdatum" date,
+    "UnderByggnation" boolean,
+    "Uppfort" date,
+    "PlaneratAntalVerkMin" smallint,
+    "PlaneratAntalVerkMax" smallint,
+    "PlaneradHojdMin" smallint,
+    "PlaneradHojdMax" smallint,
+    "PlaneradProduktionMin" real,
+    "PlaneradProduktionMax" real,
+    "PlaneradByggstart" date,
+    "PlaneratDrift" date,
+    "BeviljatAntalVerk" smallint,
+    "UppfortAntalVerk" smallint,
+    "BeviljadMaxhojd" smallint,
+    "InstalleradEffekt" real,
+    "Calprod" real,
+    "ElNamn" character varying(62) NOT NULL,
+    "SenasteUppdaterat" date NOT NULL,
+    "Raderat" boolean NOT NULL,
+    wkb_geometry postgis.geometry(MultiPolygon,3006)
+);
+
+
+ALTER TABLE postgis."vbk:havsbaserad_vindkraft" OWNER TO webmap_import;
+
+--
+-- Name: TABLE "vbk:havsbaserad_vindkraft"; Type: COMMENT; Schema: postgis; Owner: webmap_import
+--
+
+COMMENT ON TABLE postgis."vbk:havsbaserad_vindkraft" IS 'Vindbrukskollen havsbaserad vindkraft (Länsstyrelsen)';
+
+
+--
+-- Name: vbk:havsbaserad_vindkraft_ogc_fid_seq; Type: SEQUENCE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE SEQUENCE postgis."vbk:havsbaserad_vindkraft_ogc_fid_seq"
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE postgis."vbk:havsbaserad_vindkraft_ogc_fid_seq" OWNER TO webmap_import;
+
+--
+-- Name: vbk:havsbaserad_vindkraft_ogc_fid_seq; Type: SEQUENCE OWNED BY; Schema: postgis; Owner: webmap_import
+--
+
+ALTER SEQUENCE postgis."vbk:havsbaserad_vindkraft_ogc_fid_seq" OWNED BY postgis."vbk:havsbaserad_vindkraft".ogc_fid;
+
+
+--
+-- Name: vbk:projekteringsomraden; Type: TABLE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE TABLE postgis."vbk:projekteringsomraden" (
+    ogc_fid bigint NOT NULL,
+    "OmrID" character(10) NOT NULL,
+    "Projektnamn" character varying(62),
+    "AntalVerk" smallint NOT NULL,
+    "AntalEjXY" smallint NOT NULL,
+    "Calprod" real,
+    "PlaneradByggstart" date,
+    "PlaneratDrift" date,
+    "AndringsansokanPagar" boolean,
+    "UnderByggnation" boolean,
+    "Organisationsnamn" character varying(254),
+    "Organisationsnummer" character(11),
+    "ElNamn" character varying(62) NOT NULL,
+    "SenasteUppdaterat" date,
+    "EjAktuell" boolean NOT NULL,
+    "Raderat" boolean NOT NULL,
+    wkb_geometry postgis.geometry(MultiPolygon,3006)
+);
+
+
+ALTER TABLE postgis."vbk:projekteringsomraden" OWNER TO webmap_import;
+
+--
+-- Name: TABLE "vbk:projekteringsomraden"; Type: COMMENT; Schema: postgis; Owner: webmap_import
+--
+
+COMMENT ON TABLE postgis."vbk:projekteringsomraden" IS 'Vindbrukskollen landbaserade projekteringsområden (Länsstyrelsen)';
+
+
+--
+-- Name: vbk:projekteringsomraden_ogc_fid_seq; Type: SEQUENCE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE SEQUENCE postgis."vbk:projekteringsomraden_ogc_fid_seq"
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE postgis."vbk:projekteringsomraden_ogc_fid_seq" OWNER TO webmap_import;
+
+--
+-- Name: vbk:projekteringsomraden_ogc_fid_seq; Type: SEQUENCE OWNED BY; Schema: postgis; Owner: webmap_import
+--
+
+ALTER SEQUENCE postgis."vbk:projekteringsomraden_ogc_fid_seq" OWNED BY postgis."vbk:projekteringsomraden".ogc_fid;
+
+
+--
+-- Name: vbk:vindkraftverk; Type: TABLE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE TABLE postgis."vbk:vindkraftverk" (
+    ogc_fid bigint NOT NULL,
+    "VerkID" character(14) NOT NULL,
+    "OmrID" character(10) NOT NULL,
+    "Projektnamn" character varying(62),
+    "Status" character varying(62) NOT NULL,
+    "Statuskod" smallint NOT NULL,
+    "Handlingstyp" character varying(62),
+    "Uppfort" date,
+    "MB_Tillstand" date,
+    "Totalhojd" smallint,
+    "Navhojd" smallint,
+    "Rotordiameter" smallint,
+    "Maxeffekt" real,
+    "Calprod" real,
+    "Fabrikat" character varying(62),
+    "Modell" character varying(62),
+    "Organisationsnamn" character varying(254),
+    "Organisationsnummer" character(11),
+    "Placering" character varying(62),
+    "ElNamn" character varying(62) NOT NULL,
+    "SenasteUppdaterat" date,
+    "EjAktuell" boolean,
+    "Raderat" boolean NOT NULL,
+    wkb_geometry postgis.geometry(Point,3006)
+);
+
+
+ALTER TABLE postgis."vbk:vindkraftverk" OWNER TO webmap_import;
+
+--
+-- Name: TABLE "vbk:vindkraftverk"; Type: COMMENT; Schema: postgis; Owner: webmap_import
+--
+
+COMMENT ON TABLE postgis."vbk:vindkraftverk" IS 'Vindbrukskollen landbaserade vindkraftverk (Länsstyrelsen)';
+
+
+--
+-- Name: vbk:vindkraftverk_ogc_fid_seq; Type: SEQUENCE; Schema: postgis; Owner: webmap_import
+--
+
+CREATE SEQUENCE postgis."vbk:vindkraftverk_ogc_fid_seq"
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE postgis."vbk:vindkraftverk_ogc_fid_seq" OWNER TO webmap_import;
+
+--
+-- Name: vbk:vindkraftverk_ogc_fid_seq; Type: SEQUENCE OWNED BY; Schema: postgis; Owner: webmap_import
+--
+
+ALTER SEQUENCE postgis."vbk:vindkraftverk_ogc_fid_seq" OWNED BY postgis."vbk:vindkraftverk".ogc_fid;
+
+
 --
 -- Name: kommunyta ogc_fid; Type: DEFAULT; Schema: postgis; Owner: webmap_import
 --
@@ -722,6 +912,27 @@ 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: vbk:havsbaserad_vindkraft ogc_fid; Type: DEFAULT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."vbk:havsbaserad_vindkraft" ALTER COLUMN ogc_fid SET DEFAULT nextval('postgis."vbk:havsbaserad_vindkraft_ogc_fid_seq"'::regclass);
+
+
+--
+-- Name: vbk:projekteringsomraden ogc_fid; Type: DEFAULT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."vbk:projekteringsomraden" ALTER COLUMN ogc_fid SET DEFAULT nextval('postgis."vbk:projekteringsomraden_ogc_fid_seq"'::regclass);
+
+
+--
+-- Name: vbk:vindkraftverk ogc_fid; Type: DEFAULT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."vbk:vindkraftverk" ALTER COLUMN ogc_fid SET DEFAULT nextval('postgis."vbk:vindkraftverk_ogc_fid_seq"'::regclass);
+
+
 --
 -- Name: kommunyta kommunyta_kommunkod_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
 --
@@ -1018,6 +1229,46 @@ ALTER TABLE ONLY postgis."sks:UtfordAvverk"
     ADD CONSTRAINT "sks:UtfordAvverk_pkey" PRIMARY KEY (ogc_fid);
 
 
+--
+-- Name: vbk:havsbaserad_vindkraft vbk:havsbaserad_vindkraft_pkey; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."vbk:havsbaserad_vindkraft"
+    ADD CONSTRAINT "vbk:havsbaserad_vindkraft_pkey" PRIMARY KEY (ogc_fid);
+
+
+--
+-- Name: vbk:projekteringsomraden vbk:projekteringsomraden_OmrID_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."vbk:projekteringsomraden"
+    ADD CONSTRAINT "vbk:projekteringsomraden_OmrID_key" UNIQUE ("OmrID");
+
+
+--
+-- Name: vbk:projekteringsomraden vbk:projekteringsomraden_pkey; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."vbk:projekteringsomraden"
+    ADD CONSTRAINT "vbk:projekteringsomraden_pkey" PRIMARY KEY (ogc_fid);
+
+
+--
+-- Name: vbk:vindkraftverk vbk:vindkraftverk_VerkID_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."vbk:vindkraftverk"
+    ADD CONSTRAINT "vbk:vindkraftverk_VerkID_key" UNIQUE ("VerkID");
+
+
+--
+-- Name: vbk:vindkraftverk vbk:vindkraftverk_pkey; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."vbk:vindkraftverk"
+    ADD CONSTRAINT "vbk:vindkraftverk_pkey" PRIMARY KEY (ogc_fid);
+
+
 --
 -- Name: kommunyta_wkb_geometry_geom_idx; Type: INDEX; Schema: postgis; Owner: webmap_import
 --
@@ -1102,6 +1353,27 @@ 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: vbk:havsbaserad_vindkraft_wkb_geometry_geom_idx; Type: INDEX; Schema: postgis; Owner: webmap_import
+--
+
+CREATE INDEX "vbk:havsbaserad_vindkraft_wkb_geometry_geom_idx" ON postgis."vbk:havsbaserad_vindkraft" USING gist (wkb_geometry);
+
+
+--
+-- Name: vbk:projekteringsomraden_wkb_geometry_geom_idx; Type: INDEX; Schema: postgis; Owner: webmap_import
+--
+
+CREATE INDEX "vbk:projekteringsomraden_wkb_geometry_geom_idx" ON postgis."vbk:projekteringsomraden" USING gist (wkb_geometry);
+
+
+--
+-- Name: vbk:vindkraftverk_wkb_geometry_geom_idx; Type: INDEX; Schema: postgis; Owner: webmap_import
+--
+
+CREATE INDEX "vbk:vindkraftverk_wkb_geometry_geom_idx" ON postgis."vbk:vindkraftverk" USING gist (wkb_geometry);
+
+
 --
 -- Name: DATABASE webmap; Type: ACL; Schema: -; Owner: postgres
 --
@@ -1307,6 +1579,48 @@ GRANT SELECT,USAGE ON SEQUENCE postgis."sks:UtfordAvverk_ogc_fid_seq" TO webmap_
 GRANT SELECT ON TABLE postgis.spatial_ref_sys TO webmap_guest;
 
 
+--
+-- Name: TABLE "vbk:havsbaserad_vindkraft"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT ON TABLE postgis."vbk:havsbaserad_vindkraft" TO webmap_guest;
+
+
+--
+-- Name: SEQUENCE "vbk:havsbaserad_vindkraft_ogc_fid_seq"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT,USAGE ON SEQUENCE postgis."vbk:havsbaserad_vindkraft_ogc_fid_seq" TO webmap_guest;
+
+
+--
+-- Name: TABLE "vbk:projekteringsomraden"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT ON TABLE postgis."vbk:projekteringsomraden" TO webmap_guest;
+
+
+--
+-- Name: SEQUENCE "vbk:projekteringsomraden_ogc_fid_seq"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT,USAGE ON SEQUENCE postgis."vbk:projekteringsomraden_ogc_fid_seq" TO webmap_guest;
+
+
+--
+-- Name: TABLE "vbk:vindkraftverk"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT ON TABLE postgis."vbk:vindkraftverk" TO webmap_guest;
+
+
+--
+-- Name: SEQUENCE "vbk:vindkraftverk_ogc_fid_seq"; Type: ACL; Schema: postgis; Owner: webmap_import
+--
+
+GRANT SELECT,USAGE ON SEQUENCE postgis."vbk:vindkraftverk_ogc_fid_seq" TO webmap_guest;
+
+
 --
 -- PostgreSQL database dump complete
 --
-- 
cgit v1.2.3

