Mercurial > dive4elements > river
diff flys-backend/doc/schema/oracle-spatial.sql @ 1248:f36ed659003c
Added schema river_axes.
flys-backend/trunk@2728 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Bjoern Schilberg <bjoern@intevation.de> |
---|---|
date | Wed, 14 Sep 2011 08:54:07 +0000 |
parents | 6c6c5500d72d |
children | 735717961e0b |
line wrap: on
line diff
--- a/flys-backend/doc/schema/oracle-spatial.sql Wed Sep 14 08:07:08 2011 +0000 +++ b/flys-backend/doc/schema/oracle-spatial.sql Wed Sep 14 08:54:07 2011 +0000 @@ -83,6 +83,22 @@ --/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 CREATE INDEX fixpoints_spatial_idx ON fixpoints(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=POINT'); - +-- Geodaesie/Flussachse+km/achse +CREATE SEQUENCE RIVER_AXES_ID_SEQ; +CREATE TABLE river_axes( + OGR_FID NUMBER(38), + GEOM MDSYS.SDO_GEOMETRY, + river_id NUMBER(38), + kind NUMBER(38) DEFAULT 0 NOT NULL, + ID NUMBER PRIMARY KEY NOT NULL +); +--Extent: (2539488.036000, 5450928.892000) - (2575486.407000, 5507352.839000) +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); +CREATE OR REPLACE TRIGGER river_axes_trigger BEFORE INSERT ON river_axes FOR each ROW + BEGIN + SELECT RIVER_AXES_ID_SEQ.nextval INTO :new.id FROM dual; + END; +/ +CREATE INDEX river_axes_spatial_idx ON river_axes(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE'); END;