
bjoern@1244: -- Hydrologie/Einzugsgebiete/EZG.shp
bjoern@1244: CREATE SEQUENCE CATCHMENT_ID_SEQ;
bjoern@1244: CREATE TABLE catchment(
bjoern@1244:     OGR_FID NUMBER(38),
bjoern@1244:     GEOM MDSYS.SDO_GEOMETRY,
bjoern@1244:     river_id NUMBER(38),
bjoern@1244:     area NUMBER(19,5),
bjoern@2335:     name VARCHAR2(255),
bjoern@1244:     ID NUMBER PRIMARY KEY NOT NULL
bjoern@1244: );
bjoern@2338: INSERT INTO USER_SDO_GEOM_METADATA VALUES ('CATCHMENT', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2457864.326387,2634771.191263,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5297459.306295,5586961.449130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
bjoern@1244: 
bjoern@1244: CREATE TRIGGER catchment_trigger BEFORE INSERT ON catchment FOR each ROW
bjoern@1244:     BEGIN
bjoern@1244:         SELECT CATCHMENT_ID_SEQ.nextval INTO :new.id FROM dual;
bjoern@1244:     END;
bjoern@1244: /
bjoern@1253: --CREATE INDEX catchment_spatial_idx ON catchment(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=polygon');
bjoern@1244: 
bjoern@1244: -- Geodaesie/Flussachse+km/km.shp
bjoern@1245: CREATE SEQUENCE RIVER_AXES_KM_ID_SEQ;
bjoern@1245: CREATE TABLE river_axes_km(
bjoern@1244:     OGR_FID NUMBER(38),
bjoern@1244:     GEOM MDSYS.SDO_GEOMETRY,
bjoern@1244:     river_id NUMBER(38),
bjoern@1244:     km NUMBER(6,3),
bjoern@1244:     ID NUMBER PRIMARY KEY NOT NULL
bjoern@1244: );
bjoern@2338: INSERT INTO USER_SDO_GEOM_METADATA VALUES ('river_axes_km', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2457864.326387,2634771.191263,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5297459.306295,5586961.449130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
bjoern@1245: CREATE OR REPLACE TRIGGER river_axes_km_trigger BEFORE INSERT ON river_axes_km FOR each ROW
bjoern@1244:     BEGIN
bjoern@1245:         SELECT river_axes_km_ID_SEQ.nextval INTO :new.id FROM dual;
bjoern@1244:     END;
bjoern@1244: /
bjoern@1253: --CREATE INDEX river_axes_km_spatial_idx ON river_axes_km(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=point');
bjoern@1244: 
bjoern@1246: -- Geodaesie/Bauwerke/Wehre.shp
bjoern@1246: CREATE SEQUENCE BUILDINGS_ID_SEQ;
bjoern@1246: CREATE TABLE buildings(
bjoern@1246:     OGR_FID NUMBER(38),
bjoern@1246:     GEOM MDSYS.SDO_GEOMETRY,
bjoern@1246:     river_id NUMBER(38),
bjoern@2335:     name VARCHAR2(255),
bjoern@1246:     ID NUMBER PRIMARY KEY NOT NULL
bjoern@1246: );
bjoern@2338: INSERT INTO USER_SDO_GEOM_METADATA VALUES ('buildings', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2457864.326387,2634771.191263,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5297459.306295,5586961.449130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
bjoern@1246: CREATE OR REPLACE TRIGGER buildings_trigger BEFORE INSERT ON buildings FOR each ROW
bjoern@1246:     BEGIN
bjoern@1246:         SELECT BUILDINGS_ID_SEQ.nextval INTO :new.id FROM dual;
bjoern@1246:     END;
bjoern@1246: /
bjoern@1253: --CREATE INDEX buildings_spatial_idx ON buildings(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
bjoern@1246: 
bjoern@1247: -- Geodaesie/Festpunkte/Festpunkte.shp
bjoern@1247: CREATE SEQUENCE FIXPOINTS_ID_SEQ;
bjoern@1247: CREATE TABLE fixpoints (
bjoern@1247:     OGR_FID NUMBER(38),
bjoern@1247:     GEOM MDSYS.SDO_GEOMETRY,
bjoern@1247:     river_id NUMBER(38),
bjoern@2335:     x NUMBER(38,11),
bjoern@2335:     y NUMBER(38,11),
bjoern@2335:     km NUMBER(38,11) NOT NULL,
bjoern@2335:     HPGP VARCHAR2(255),
bjoern@1247:     ID NUMBER PRIMARY KEY NOT NULL
bjoern@1247: );
bjoern@1247: --Extent: (2539388.036000, 5450896.688000) - (2575586.296000, 5507370.606000)
bjoern@2338: INSERT INTO USER_SDO_GEOM_METADATA VALUES ('fixpoints', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2457864.326387,2634771.191263,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5297459.306295,5586961.449130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
bjoern@1247: CREATE OR REPLACE TRIGGER fixpoints_trigger BEFORE INSERT ON fixpoints FOR each ROW
bjoern@1247:     BEGIN
bjoern@1247:         SELECT FIXPOINTS_ID_SEQ.nextval INTO :new.id FROM dual;
bjoern@1247:     END;
bjoern@1247: /
bjoern@1253: --CREATE INDEX fixpoints_spatial_idx ON fixpoints(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=POINT');
bjoern@1247: 
bjoern@1248: -- Geodaesie/Flussachse+km/achse
bjoern@1248: CREATE SEQUENCE RIVER_AXES_ID_SEQ;
bjoern@1248: CREATE TABLE river_axes(
bjoern@1248:     OGR_FID NUMBER(38),
bjoern@1248:     GEOM MDSYS.SDO_GEOMETRY,
bjoern@1248:     river_id NUMBER(38),
bjoern@1248:     kind     NUMBER(38) DEFAULT 0 NOT NULL,
bjoern@1248:     ID NUMBER PRIMARY KEY NOT NULL
bjoern@1248: );
bjoern@2338: INSERT INTO USER_SDO_GEOM_METADATA VALUES ('river_axes', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2457864.326387,2634771.191263,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5297459.306295,5586961.449130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
bjoern@1248: CREATE OR REPLACE TRIGGER river_axes_trigger BEFORE INSERT ON river_axes FOR each ROW
bjoern@1248:     BEGIN
bjoern@1248:         SELECT RIVER_AXES_ID_SEQ.nextval INTO :new.id FROM dual;
bjoern@1248:     END;
bjoern@1248: /
bjoern@1253: --CREATE INDEX river_axes_spatial_idx ON river_axes(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
bjoern@1246: 
bjoern@1249: --Geodaesie/Querprofile/QP-Spuren/qps.shp
bjoern@1249: CREATE SEQUENCE CROSS_SECTION_TRACKS_ID_SEQ;
bjoern@1249: CREATE TABLE cross_section_tracks (
bjoern@1249:     OGR_FID NUMBER(38),
bjoern@1249:     GEOM MDSYS.SDO_GEOMETRY,
bjoern@1249:     river_id NUMBER(38),
bjoern@2335:     km       NUMBER(38,12) NOT NULL,
bjoern@2338:     z        NUMBER(38,12) DEFAULT 0 NOT NULL,
bjoern@1249:     ID NUMBER PRIMARY KEY NOT NULL
bjoern@1249: );
bjoern@2338: INSERT INTO USER_SDO_GEOM_METADATA VALUES ('cross_section_tracks', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2457864.326387,2634771.191263,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5297459.306295,5586961.449130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
bjoern@1249: CREATE OR REPLACE TRIGGER cross_section_tracks_trigger BEFORE INSERT ON cross_section_tracks FOR each ROW
bjoern@1249:     BEGIN
bjoern@1249:         SELECT CROSS_SECTION_TRACKS_ID_SEQ.nextval INTO :new.id FROM dual;
bjoern@1249:     END;
bjoern@1249: /
bjoern@1253: --CREATE INDEX CrossSectionTracks_spatial_idx ON cross_section_tracks(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
bjoern@1249: 
bjoern@1250: --Hydrologie/HW-Schutzanlagen/hws.shp
bjoern@1250: CREATE SEQUENCE HWS_ID_SEQ;
bjoern@1250: CREATE TABLE hws(
bjoern@1250:     OGR_FID NUMBER(38),
bjoern@1250:     GEOM MDSYS.SDO_GEOMETRY,
bjoern@1250:     river_id NUMBER(38),
bjoern@2335:     hws_facility VARCHAR2(255),
bjoern@2335:     type VARCHAR2(255),
bjoern@1250:     ID NUMBER PRIMARY KEY NOT NULL
bjoern@1250: );
bjoern@2338: INSERT INTO USER_SDO_GEOM_METADATA VALUES ('hws', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2457864.326387,2634771.191263,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5297459.306295,5586961.449130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
bjoern@1250: CREATE OR REPLACE TRIGGER hws_trigger BEFORE INSERT ON hws FOR each ROW
bjoern@1250:     BEGIN
bjoern@1250:         SELECT HWS_ID_SEQ.nextval INTO :new.id FROM dual;
bjoern@1250:     END;
bjoern@1250: /
bjoern@1253: --CREATE INDEX hws_spatial_idx ON hws(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
bjoern@1250: 
bjoern@1251: -- Hydrologie/Hydr. Grenzen/talaue.shp
bjoern@1251: CREATE SEQUENCE FLOODPLAIN_ID_SEQ;
bjoern@1251: CREATE TABLE floodplain(
bjoern@1251:     OGR_FID NUMBER(38),
bjoern@1251:     GEOM MDSYS.SDO_GEOMETRY,
bjoern@1251:     river_id NUMBER(38),
bjoern@1251:     ID NUMBER PRIMARY KEY NOT NULL
bjoern@1251: );
bjoern@2338: INSERT INTO USER_SDO_GEOM_METADATA VALUES ('floodplain', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2457864.326387,2634771.191263,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5297459.306295,5586961.449130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466);
bjoern@1251: CREATE OR REPLACE TRIGGER floodplain_trigger BEFORE INSERT ON floodplain FOR each ROW
bjoern@1251:     BEGIN
bjoern@1251:         SELECT FLOODPLAIN_ID_SEQ.nextval INTO :new.id FROM dual;
bjoern@1251:     END;
bjoern@1251: /
bjoern@1253: --CREATE INDEX floodplain_spatial_idx ON floodplain(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=POLYGON');




