Chapitre VI :
Développement web Cartographique
100
5 Code SQL pour la génération de la structure de la GEODATABASE :
-- SCHEMA: Energie_renouvlable
-- DROP SCHEMA IF EXISTS "Energie_renouvlable" ;
CREATE SCHEMA IF NOT EXISTS "Energie_renouvlable"
AUTHORIZATION postgres;
-- Table: Energie_renouvlable.Traits_de_cotes
-- DROP TABLE IF EXISTS "Energie_renouvlable"."Traits_de_cotes";
CREATE TABLE IF NOT EXISTS "Energie_renouvlable"."Traits_de_cotes"
(id integer NOT NULL DEFAULT nextval('"Energie_renouvlable"."Traits_de_cotes_id_seq"'::regclass),
geom geometry(MultiLineString,4326),
objectid bigint,
wilaya character varying(50) COLLATE pg_catalog."default",
shape_leng double precision,
CONSTRAINT "Traits_de_cotes_pkey" PRIMARY KEY (id))
TABLESPACE pg_default;
ALTER TABLE IF EXISTS "Energie_renouvlable"."Traits_de_cotes"
OWNER to postgres;
-- Table: Energie_renouvlable.bathy
-- DROP TABLE IF EXISTS "Energie_renouvlable".bathy;
CREATE TABLE IF NOT EXISTS "Energie_renouvlable".bathy
(id integer NOT NULL DEFAULT nextval('"Energie_renouvlable".bathy_id_seq'::regclass),
geom geometry(PointZ,4326),
objectid bigint,
z double precision,
wilaya character varying(50) COLLATE pg_catalog."default",
CONSTRAINT bathy_pkey PRIMARY KEY (id))
TABLESPACE pg_default;
ALTER TABLE IF EXISTS "Energie_renouvlable".bathy
OWNER to postgres;
-- Table: Energie_renouvlable.donnees_climato_algerie
-- DROP TABLE IF EXISTS "Energie_renouvlable".donnees_climato_algerie;
CREATE TABLE IF NOT EXISTS "Energie_renouvlable".donnees_climato_algerie
( id integer NOT NULL DEFAULT nextval('"Energie_renouvlable"."données climato algerie_id_seq"'::regclass),
"Year" integer,
"Month" integer,
"Day" integer,
"Hour" integer,
u10 double precision,
u10d integer,
"Hs" double precision,
"Hsd" character varying COLLATE pg_catalog."default",
"Tz" character varying COLLATE pg_catalog."default",
"Tm" character varying COLLATE pg_catalog."default",
"Tp" character varying COLLATE pg_catalog."default",
"Hs_sea" double precision,
"Hsd_sea" integer,
"Tz_sea" double precision,
"Tm_sea" double precision,
"Tp_sea" double precision,
"Hs_swl" double precision,
"Hsd_swl" character varying COLLATE pg_catalog."default",
"Tz_swl" character varying COLLATE pg_catalog."default",
"Tm_swl" character varying COLLATE pg_catalog."default",
"Tp_swl" character varying COLLATE pg_catalog."default",
id_ptex character varying(50) COLLATE pg_catalog."default",
CONSTRAINT "données climato algerie_pkey" PRIMARY KEY (id),
CONSTRAINT "données climato algerie_id_ptex_fkey" FOREIGN KEY (id_ptex)
REFERENCES "Energie_renouvlable".points_d_extractions (id_ptex) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS "Energie_renouvlable".donnees_climato_algerie
OWNER to postgres;
-- Table: Energie_renouvlable.points_d_extractions
-- DROP TABLE IF EXISTS "Energie_renouvlable".points_d_extractions;
CREATE TABLE IF NOT EXISTS "Energie_renouvlable".points_d_extractions
( geom geometry(Point,4326),
wilaya character varying(254) COLLATE pg_catalog."default",
id_ptex character varying(50) COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT points_d_extractions_pkey PRIMARY KEY (id_ptex))
TABLESPACE pg_default;
ALTER TABLE IF EXISTS "Energie_renouvlable".points_d_extractions
OWNER to postgres;
-- Table: energie_renouvelable.zone_de_fort_potentiel_energitique
-- DROP TABLE IF EXISTS energie_renouvelable.zone_de_fort_potentiel_energitique;
CREATE TABLE IF NOT EXISTS energie_renouvelable.zone_de_fort_potentiel_energitique
(id integer NOT NULL DEFAULT nextval('energie_renouvelable.zone_de_fort_potentiel_energitique_id_seq'::regclass),
geom geometry(MultiPolygonZ,4326),
objectid bigint,
from_ double precision,
to_ double precision,
type character varying(50) COLLATE pg_catalog."default",
wilaya character varying(50) COLLATE pg_catalog."default",
shape_leng double precision,
shape_area double precision,
CONSTRAINT zone_de_fort_potentiel_energitique_pkey PRIMARY KEY (id))
TABLESPACE pg_default;
ALTER TABLE IF EXISTS energie_renouvelable.zone_de_fort_potentiel_energitique
OWNER to postgres;
Figure N° 113: Présentation du code SQL de la base de données.
Développement web Cartographique
100
5 Code SQL pour la génération de la structure de la GEODATABASE :
-- SCHEMA: Energie_renouvlable
-- DROP SCHEMA IF EXISTS "Energie_renouvlable" ;
CREATE SCHEMA IF NOT EXISTS "Energie_renouvlable"
AUTHORIZATION postgres;
-- Table: Energie_renouvlable.Traits_de_cotes
-- DROP TABLE IF EXISTS "Energie_renouvlable"."Traits_de_cotes";
CREATE TABLE IF NOT EXISTS "Energie_renouvlable"."Traits_de_cotes"
(id integer NOT NULL DEFAULT nextval('"Energie_renouvlable"."Traits_de_cotes_id_seq"'::regclass),
geom geometry(MultiLineString,4326),
objectid bigint,
wilaya character varying(50) COLLATE pg_catalog."default",
shape_leng double precision,
CONSTRAINT "Traits_de_cotes_pkey" PRIMARY KEY (id))
TABLESPACE pg_default;
ALTER TABLE IF EXISTS "Energie_renouvlable"."Traits_de_cotes"
OWNER to postgres;
-- Table: Energie_renouvlable.bathy
-- DROP TABLE IF EXISTS "Energie_renouvlable".bathy;
CREATE TABLE IF NOT EXISTS "Energie_renouvlable".bathy
(id integer NOT NULL DEFAULT nextval('"Energie_renouvlable".bathy_id_seq'::regclass),
geom geometry(PointZ,4326),
objectid bigint,
z double precision,
wilaya character varying(50) COLLATE pg_catalog."default",
CONSTRAINT bathy_pkey PRIMARY KEY (id))
TABLESPACE pg_default;
ALTER TABLE IF EXISTS "Energie_renouvlable".bathy
OWNER to postgres;
-- Table: Energie_renouvlable.donnees_climato_algerie
-- DROP TABLE IF EXISTS "Energie_renouvlable".donnees_climato_algerie;
CREATE TABLE IF NOT EXISTS "Energie_renouvlable".donnees_climato_algerie
( id integer NOT NULL DEFAULT nextval('"Energie_renouvlable"."données climato algerie_id_seq"'::regclass),
"Year" integer,
"Month" integer,
"Day" integer,
"Hour" integer,
u10 double precision,
u10d integer,
"Hs" double precision,
"Hsd" character varying COLLATE pg_catalog."default",
"Tz" character varying COLLATE pg_catalog."default",
"Tm" character varying COLLATE pg_catalog."default",
"Tp" character varying COLLATE pg_catalog."default",
"Hs_sea" double precision,
"Hsd_sea" integer,
"Tz_sea" double precision,
"Tm_sea" double precision,
"Tp_sea" double precision,
"Hs_swl" double precision,
"Hsd_swl" character varying COLLATE pg_catalog."default",
"Tz_swl" character varying COLLATE pg_catalog."default",
"Tm_swl" character varying COLLATE pg_catalog."default",
"Tp_swl" character varying COLLATE pg_catalog."default",
id_ptex character varying(50) COLLATE pg_catalog."default",
CONSTRAINT "données climato algerie_pkey" PRIMARY KEY (id),
CONSTRAINT "données climato algerie_id_ptex_fkey" FOREIGN KEY (id_ptex)
REFERENCES "Energie_renouvlable".points_d_extractions (id_ptex) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS "Energie_renouvlable".donnees_climato_algerie
OWNER to postgres;
-- Table: Energie_renouvlable.points_d_extractions
-- DROP TABLE IF EXISTS "Energie_renouvlable".points_d_extractions;
CREATE TABLE IF NOT EXISTS "Energie_renouvlable".points_d_extractions
( geom geometry(Point,4326),
wilaya character varying(254) COLLATE pg_catalog."default",
id_ptex character varying(50) COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT points_d_extractions_pkey PRIMARY KEY (id_ptex))
TABLESPACE pg_default;
ALTER TABLE IF EXISTS "Energie_renouvlable".points_d_extractions
OWNER to postgres;
-- Table: energie_renouvelable.zone_de_fort_potentiel_energitique
-- DROP TABLE IF EXISTS energie_renouvelable.zone_de_fort_potentiel_energitique;
CREATE TABLE IF NOT EXISTS energie_renouvelable.zone_de_fort_potentiel_energitique
(id integer NOT NULL DEFAULT nextval('energie_renouvelable.zone_de_fort_potentiel_energitique_id_seq'::regclass),
geom geometry(MultiPolygonZ,4326),
objectid bigint,
from_ double precision,
to_ double precision,
type character varying(50) COLLATE pg_catalog."default",
wilaya character varying(50) COLLATE pg_catalog."default",
shape_leng double precision,
shape_area double precision,
CONSTRAINT zone_de_fort_potentiel_energitique_pkey PRIMARY KEY (id))
TABLESPACE pg_default;
ALTER TABLE IF EXISTS energie_renouvelable.zone_de_fort_potentiel_energitique
OWNER to postgres;
Figure N° 113: Présentation du code SQL de la base de données.
