diff flys-backend/doc/schema/oracle-spatial.sql @ 2340:c4f090a00178

Added missing schemas. flys-backend/trunk@2818 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Bjoern Schilberg <bjoern@intevation.de>
date Fri, 23 Sep 2011 11:15:20 +0000
parents b28ab244a77d
children 60532f75396b
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle-spatial.sql	Fri Sep 23 10:42:25 2011 +0000
+++ b/flys-backend/doc/schema/oracle-spatial.sql	Fri Sep 23 11:15:20 2011 +0000
@@ -53,8 +53,29 @@
 --CREATE INDEX CrossSectionTracks_spatial_idx ON cross_section_tracks(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
 
 
--- TODO
--- Geodaesie/Linien/rohre-und-spreen
+-- TODO: TestMe. Fix Importer-Script. Fix oracle_spatial_idx.sql script.
+-- Geodaesie/Linien/rohre-und-speeren
+CREATE SEQUENCE LINES_ID_SEQ;
+CREATE TABLE lines (
+    OGR_FID NUMBER(38),
+    GEOM MDSYS.SDO_GEOMETRY,
+    river_id NUMBER(38),
+    kind     NUMBER(38) DEFAULT 0 NOT NULL,
+    z        NUMBER(38,12) DEFAULT 0,
+    ID NUMBER PRIMARY KEY NOT NULL
+);
+INSERT INTO USER_SDO_GEOM_METADATA VALUES ('lines', '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);
+CREATE OR REPLACE TRIGGER lines_trigger BEFORE INSERT ON lines FOR each ROW
+    BEGIN
+        SELECT LINES_ID_SEQ.nextval INTO :new.id FROM dual;
+    END;
+/
+-- NOTE: Should lines should be 3D.
+-- TODO: Test index. 
+--CREATE INDEX lines_idx ON lines(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
+-- 'kind':
+-- 0: ROHR1
+-- 1: DAMM
 
 
 -- Geodaesie/Bauwerke/Wehre.shp
@@ -113,8 +134,24 @@
 --CREATE INDEX floodplain_spatial_idx ON floodplain(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=POLYGON');
 
 
--- TODO
+-- TODO: Test-Me. Fix Importer-Skript.
+-- NOTE: It's not a spatial schema!
 -- Geodaesie/Hoehenmodelle/*
+CREATE SEQUENCE DEM_ID_SEQ;
+CREATE TABLE dem (
+    ID NUMBER PRIMARY KEY NOT NULL,
+    river_id NUMBER(38),
+    -- XXX Should we use the ranges table instead?
+    lower    NUMBER(38),
+    upper    NUMBER(38),
+    path     VARCHAR(256),
+    UNIQUE (river_id, lower, upper)
+);
+CREATE OR REPLACE TRIGGER dem_trigger BEFORE INSERT ON dem FOR each ROW
+    BEGIN
+        SELECT DEM_ID_SEQ.nextval INTO :new.id FROM dual;
+    END;
+/
 
 
 -- Hydrologie/Einzugsgebiete/EZG.shp

http://dive4elements.wald.intevation.org