diff flys-backend/doc/schema/oracle-spatial.sql @ 1251:f124c99077b5

Added schema floodplain. flys-backend/trunk@2737 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Bjoern Schilberg <bjoern@intevation.de>
date Wed, 14 Sep 2011 10:05:09 +0000
parents 660116539429
children a75e7d922942
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle-spatial.sql	Wed Sep 14 09:49:18 2011 +0000
+++ b/flys-backend/doc/schema/oracle-spatial.sql	Wed Sep 14 10:05:09 2011 +0000
@@ -142,6 +142,22 @@
 --/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
 CREATE INDEX hws_spatial_idx ON hws(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
 
-
+-- Hydrologie/Hydr. Grenzen/talaue.shp
+CREATE SEQUENCE FLOODPLAIN_ID_SEQ;
+CREATE TABLE floodplain(
+    OGR_FID NUMBER(38),
+    GEOM MDSYS.SDO_GEOMETRY,
+    river_id NUMBER(38),
+    ID NUMBER PRIMARY KEY NOT NULL
+);
+--Extent: (2539343.776823, 5451397.340027) - (2576021.009478, 5507230.640000)
+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);
+CREATE OR REPLACE TRIGGER floodplain_trigger BEFORE INSERT ON floodplain FOR each ROW
+    BEGIN
+        SELECT FLOODPLAIN_ID_SEQ.nextval INTO :new.id FROM dual;
+    END;
+/
+--/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
+CREATE INDEX floodplain_spatial_idx ON floodplain(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=POLYGON');
 
 END;

http://dive4elements.wald.intevation.org