annotate flys-backend/doc/schema/oracle-spatial.sql @ 2335:e1fb4a1e0b4a

Generalized oracle spatial schema. flys-backend/trunk@2794 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Bjoern Schilberg <bjoern@intevation.de>
date Tue, 20 Sep 2011 13:21:29 +0000
parents a75e7d922942
children e69ef36290ae
rev   line source
1244
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
1 -- Hydrologie/Einzugsgebiete/EZG.shp
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
2
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
3 CREATE SEQUENCE CATCHMENT_ID_SEQ;
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
4 CREATE TABLE catchment(
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
5 OGR_FID NUMBER(38),
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
6 GEOM MDSYS.SDO_GEOMETRY,
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
7 river_id NUMBER(38),
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
8 area NUMBER(19,5),
2335
e1fb4a1e0b4a Generalized oracle spatial schema.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1253
diff changeset
9 name VARCHAR2(255),
1244
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
10 ID NUMBER PRIMARY KEY NOT NULL
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
11 );
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
12 --EXTENT 2520667.897954 5376316.575645 2634771.191263 5508288.005707
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
13 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('CATCHMENT', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2520667.894954166,2634771.194263435,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5376316.572645214,5508288.008706546,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
14
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
15 CREATE TRIGGER catchment_trigger BEFORE INSERT ON catchment FOR each ROW
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
16 BEGIN
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
17 SELECT CATCHMENT_ID_SEQ.nextval INTO :new.id FROM dual;
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
18 END;
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
19 /
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
20 --/opt/gdal-1.8.0/bin/ogr2ogr -f OCI OCI:flys3/flys3@localhost EZG.shp -sql 'SELECT 1 AS river_id,AREA as area, GEBIETZBEZ as name FROM EZG' -nln catchment -append
1253
a75e7d922942 Deactivated spatial indexes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1251
diff changeset
21 --CREATE INDEX catchment_spatial_idx ON catchment(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=polygon');
1244
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
22
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
23 -- Geodaesie/Flussachse+km/km.shp
1245
0414181b0859 Fixed table river_axes_km.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1244
diff changeset
24 CREATE SEQUENCE RIVER_AXES_KM_ID_SEQ;
0414181b0859 Fixed table river_axes_km.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1244
diff changeset
25 CREATE TABLE river_axes_km(
1244
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
26 OGR_FID NUMBER(38),
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
27 GEOM MDSYS.SDO_GEOMETRY,
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
28 river_id NUMBER(38),
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
29 km NUMBER(6,3),
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
30 ID NUMBER PRIMARY KEY NOT NULL
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
31 );
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
32 --Extent: (2539489.068000, 5450953.000500) - (2575482.527500, 5507278.634500)
1245
0414181b0859 Fixed table river_axes_km.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1244
diff changeset
33 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('river_axes_km', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2539491.068000,2575482.527500,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5450953.000500,5507278.634500,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
0414181b0859 Fixed table river_axes_km.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1244
diff changeset
34 CREATE OR REPLACE TRIGGER river_axes_km_trigger BEFORE INSERT ON river_axes_km FOR each ROW
1244
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
35 BEGIN
1245
0414181b0859 Fixed table river_axes_km.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1244
diff changeset
36 SELECT river_axes_km_ID_SEQ.nextval INTO :new.id FROM dual;
1244
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
37 END;
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
38 /
1245
0414181b0859 Fixed table river_axes_km.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1244
diff changeset
39 --/opt/gdal-1.8.0/bin/ogr2ogr -f OCI OCI:flys3/flys3@localhost km.shp -sql 'SELECT 1 AS river_id,km as km FROM km' -nln river_axes_km -append
1253
a75e7d922942 Deactivated spatial indexes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1251
diff changeset
40 --CREATE INDEX river_axes_km_spatial_idx ON river_axes_km(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=point');
1244
281f38fc6c3e Initial oracle schema.
Bjoern Schilberg <bjoern@intevation.de>
parents:
diff changeset
41
1246
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
42 -- Geodaesie/Bauwerke/Wehre.shp
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
43 CREATE SEQUENCE BUILDINGS_ID_SEQ;
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
44 CREATE TABLE buildings(
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
45 OGR_FID NUMBER(38),
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
46 GEOM MDSYS.SDO_GEOMETRY,
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
47 river_id NUMBER(38),
2335
e1fb4a1e0b4a Generalized oracle spatial schema.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1253
diff changeset
48 name VARCHAR2(255),
1246
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
49 ID NUMBER PRIMARY KEY NOT NULL
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
50 );
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
51 --Extent: (2540544.253718, 5456266.217464) - (2567747.834199, 5502557.982120)
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
52 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('buildings', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2540544.253718,2567747.834199,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5456266.217464,5502557.982120,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
53 CREATE OR REPLACE TRIGGER buildings_trigger BEFORE INSERT ON buildings FOR each ROW
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
54 BEGIN
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
55 SELECT BUILDINGS_ID_SEQ.nextval INTO :new.id FROM dual;
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
56 END;
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
57 /
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
58 --/opt/gdal-1.8.0/bin/ogr2ogr -f OCI OCI:flys3/flys3@localhost Wehre.shp -sql 'SELECT 1 AS river_id,Name as name FROM Wehre' -nln buildings -append
1253
a75e7d922942 Deactivated spatial indexes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1251
diff changeset
59 --CREATE INDEX buildings_spatial_idx ON buildings(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
1246
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
60
1247
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
61 -- Geodaesie/Festpunkte/Festpunkte.shp
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
62 CREATE SEQUENCE FIXPOINTS_ID_SEQ;
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
63 CREATE TABLE fixpoints (
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
64 OGR_FID NUMBER(38),
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
65 GEOM MDSYS.SDO_GEOMETRY,
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
66 river_id NUMBER(38),
2335
e1fb4a1e0b4a Generalized oracle spatial schema.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1253
diff changeset
67 x NUMBER(38,11),
e1fb4a1e0b4a Generalized oracle spatial schema.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1253
diff changeset
68 y NUMBER(38,11),
e1fb4a1e0b4a Generalized oracle spatial schema.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1253
diff changeset
69 km NUMBER(38,11) NOT NULL,
e1fb4a1e0b4a Generalized oracle spatial schema.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1253
diff changeset
70 HPGP VARCHAR2(255),
1247
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
71 ID NUMBER PRIMARY KEY NOT NULL
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
72 );
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
73 --Extent: (2539388.036000, 5450896.688000) - (2575586.296000, 5507370.606000)
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
74 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('fixpoints', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2539388.036000,2575586.296000,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5450896.688000,5507370.606000,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
75 CREATE OR REPLACE TRIGGER fixpoints_trigger BEFORE INSERT ON fixpoints FOR each ROW
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
76 BEGIN
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
77 SELECT FIXPOINTS_ID_SEQ.nextval INTO :new.id FROM dual;
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
78 END;
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
79 /
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
80 --/opt/gdal-1.8.0/bin/ogr2ogr -f OCI OCI:flys3/flys3@localhost Festpunkte.shp -sql 'SELECT 1 AS river_id,x as x,y as y, km as km, HPGP as HPGP FROM Festpunkte' -nln fixpoints -append
1253
a75e7d922942 Deactivated spatial indexes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1251
diff changeset
81 --CREATE INDEX fixpoints_spatial_idx ON fixpoints(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=POINT');
1247
6c6c5500d72d Added schema fixpoints.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1246
diff changeset
82
1248
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
83 -- Geodaesie/Flussachse+km/achse
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
84 CREATE SEQUENCE RIVER_AXES_ID_SEQ;
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
85 CREATE TABLE river_axes(
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
86 OGR_FID NUMBER(38),
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
87 GEOM MDSYS.SDO_GEOMETRY,
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
88 river_id NUMBER(38),
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
89 kind NUMBER(38) DEFAULT 0 NOT NULL,
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
90 ID NUMBER PRIMARY KEY NOT NULL
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
91 );
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
92 --Extent: (2539488.036000, 5450928.892000) - (2575486.407000, 5507352.839000)
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
93 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('river_axes', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2539488.036000,2575486.407000,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5450928.892000,5507352.839000,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
94 CREATE OR REPLACE TRIGGER river_axes_trigger BEFORE INSERT ON river_axes FOR each ROW
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
95 BEGIN
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
96 SELECT RIVER_AXES_ID_SEQ.nextval INTO :new.id FROM dual;
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
97 END;
f36ed659003c Added schema river_axes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1247
diff changeset
98 /
1249
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
99 --/opt/gdal-1.8.0/bin/ogr2ogr -f OCI OCI:flys3/flys3@localhost achse.shp -sql 'SELECT 1 AS river_id,0 as kind from achse' -nln river_axes -append
1253
a75e7d922942 Deactivated spatial indexes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1251
diff changeset
100 --CREATE INDEX river_axes_spatial_idx ON river_axes(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
1246
e334314e8eb2 Added schema buildings.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1245
diff changeset
101
1249
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
102 --Geodaesie/Querprofile/QP-Spuren/qps.shp
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
103 CREATE SEQUENCE CROSS_SECTION_TRACKS_ID_SEQ;
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
104 CREATE TABLE cross_section_tracks (
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
105 OGR_FID NUMBER(38),
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
106 GEOM MDSYS.SDO_GEOMETRY,
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
107 river_id NUMBER(38),
2335
e1fb4a1e0b4a Generalized oracle spatial schema.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1253
diff changeset
108 km NUMBER(38,12) NOT NULL,
1249
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
109 z NUMBER(18,5) DEFAULT 0 NOT NULL,
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
110 ID NUMBER PRIMARY KEY NOT NULL
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
111 );
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
112 --Extent: (2539289.724000, 5450852.896743) - (2576589.878311, 5507289.656000)
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
113 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('cross_section_tracks', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2539289.724000,2576589.878311,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5450852.896743,5507289.656000,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
114 CREATE OR REPLACE TRIGGER cross_section_tracks_trigger BEFORE INSERT ON cross_section_tracks FOR each ROW
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
115 BEGIN
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
116 SELECT CROSS_SECTION_TRACKS_ID_SEQ.nextval INTO :new.id FROM dual;
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
117 END;
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
118 /
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
119 -- /opt/gdal-1.8.0/bin/ogr2ogr -f OCI OCI:flys3/flys3@localhost qps.shp -sql 'SELECT 1 AS river_id,KILOMETER as km, ELEVATION as z from qps' -nln cross_section_tracks -append
1253
a75e7d922942 Deactivated spatial indexes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1251
diff changeset
120 --CREATE INDEX CrossSectionTracks_spatial_idx ON cross_section_tracks(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
1249
735717961e0b Added schema cross_section_tracks.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1248
diff changeset
121
1250
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
122 --Hydrologie/HW-Schutzanlagen/hws.shp
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
123 CREATE SEQUENCE HWS_ID_SEQ;
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
124 CREATE TABLE hws(
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
125 OGR_FID NUMBER(38),
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
126 GEOM MDSYS.SDO_GEOMETRY,
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
127 river_id NUMBER(38),
2335
e1fb4a1e0b4a Generalized oracle spatial schema.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1253
diff changeset
128 hws_facility VARCHAR2(255),
e1fb4a1e0b4a Generalized oracle spatial schema.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1253
diff changeset
129 type VARCHAR2(255),
1250
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
130 ID NUMBER PRIMARY KEY NOT NULL
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
131 );
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
132 --Extent: (2539778.101933, 5456638.161347) - (2567463.841704, 5500605.745332)
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
133 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('hws', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2539778.101933,2567463.841704,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5456638.161347,5500605.745332,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
134 CREATE OR REPLACE TRIGGER hws_trigger BEFORE INSERT ON hws FOR each ROW
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
135 BEGIN
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
136 SELECT HWS_ID_SEQ.nextval INTO :new.id FROM dual;
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
137 END;
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
138 /
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
139 --/opt/gdal-1.8.0/bin/ogr2ogr -f OCI OCI:flys3/flys3@localhost hws.shp -sql 'SELECT 1 AS river_id,HWS_ANLAGE as hws_facility, TYP as type from HWS' -nln hws -append
1253
a75e7d922942 Deactivated spatial indexes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1251
diff changeset
140 --CREATE INDEX hws_spatial_idx ON hws(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
1250
660116539429 Added schema hws.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1249
diff changeset
141
1251
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
142 -- Hydrologie/Hydr. Grenzen/talaue.shp
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
143 CREATE SEQUENCE FLOODPLAIN_ID_SEQ;
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
144 CREATE TABLE floodplain(
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
145 OGR_FID NUMBER(38),
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
146 GEOM MDSYS.SDO_GEOMETRY,
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
147 river_id NUMBER(38),
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
148 ID NUMBER PRIMARY KEY NOT NULL
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
149 );
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
150 --Extent: (2539343.776823, 5451397.340027) - (2576021.009478, 5507230.640000)
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
151 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('floodplain', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2539343.776823,2576021.009478,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5451397.340027,5507230.640000,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
152 CREATE OR REPLACE TRIGGER floodplain_trigger BEFORE INSERT ON floodplain FOR each ROW
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
153 BEGIN
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
154 SELECT FLOODPLAIN_ID_SEQ.nextval INTO :new.id FROM dual;
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
155 END;
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
156 /
f124c99077b5 Added schema floodplain.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1250
diff changeset
157 --/opt/gdal-1.8.0/bin/ogr2ogr -f OCI OCI:flys3/flys3@localhost talaue.shp -sql 'SELECT 1 AS river_id from talaue' -nln floodplain -append
1253
a75e7d922942 Deactivated spatial indexes.
Bjoern Schilberg <bjoern@intevation.de>
parents: 1251
diff changeset
158 --CREATE INDEX floodplain_spatial_idx ON floodplain(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=POLYGON');

http://dive4elements.wald.intevation.org