comparison 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
comparison
equal deleted inserted replaced
1250:660116539429 1251:f124c99077b5
140 END; 140 END;
141 / 141 /
142 --/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 142 --/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
143 CREATE INDEX hws_spatial_idx ON hws(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE'); 143 CREATE INDEX hws_spatial_idx ON hws(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
144 144
145 145 -- Hydrologie/Hydr. Grenzen/talaue.shp
146 CREATE SEQUENCE FLOODPLAIN_ID_SEQ;
147 CREATE TABLE floodplain(
148 OGR_FID NUMBER(38),
149 GEOM MDSYS.SDO_GEOMETRY,
150 river_id NUMBER(38),
151 ID NUMBER PRIMARY KEY NOT NULL
152 );
153 --Extent: (2539343.776823, 5451397.340027) - (2576021.009478, 5507230.640000)
154 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);
155 CREATE OR REPLACE TRIGGER floodplain_trigger BEFORE INSERT ON floodplain FOR each ROW
156 BEGIN
157 SELECT FLOODPLAIN_ID_SEQ.nextval INTO :new.id FROM dual;
158 END;
159 /
160 --/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
161 CREATE INDEX floodplain_spatial_idx ON floodplain(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=POLYGON');
146 162
147 END; 163 END;

http://dive4elements.wald.intevation.org