# HG changeset patch # User Bjoern Schilberg # Date 1315993758 0 # Node ID 660116539429864894267e01440d79436068a56b # Parent 735717961e0b644438c040329736a98c6f9229eb Added schema hws. flys-backend/trunk@2734 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 735717961e0b -r 660116539429 flys-backend/ChangeLog --- a/flys-backend/ChangeLog Wed Sep 14 09:28:20 2011 +0000 +++ b/flys-backend/ChangeLog Wed Sep 14 09:49:18 2011 +0000 @@ -1,3 +1,7 @@ +2011-09-14 Bjoern Schilberg + + * doc/schema/oracle-spatial.sql: Added schema hws. + 2011-09-14 Bjoern Schilberg * doc/schema/oracle-spatial.sql: Added schema cross_section_tracks. diff -r 735717961e0b -r 660116539429 flys-backend/doc/schema/oracle-spatial.sql --- a/flys-backend/doc/schema/oracle-spatial.sql Wed Sep 14 09:28:20 2011 +0000 +++ b/flys-backend/doc/schema/oracle-spatial.sql Wed Sep 14 09:49:18 2011 +0000 @@ -122,4 +122,26 @@ -- /opt/gdal-1.8.0/bin/ogr2ogr -f OCI OCI:flys3/flys3@localhost qps.shp -sql 'SELECT 1 AS river_id,KILOMETER as km, ELEVATION as z from qps' -nln cross_section_tracks -append CREATE INDEX CrossSectionTracks_spatial_idx ON cross_section_tracks(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE'); +--Hydrologie/HW-Schutzanlagen/hws.shp +CREATE SEQUENCE HWS_ID_SEQ; +CREATE TABLE hws( + OGR_FID NUMBER(38), + GEOM MDSYS.SDO_GEOMETRY, + river_id NUMBER(38), + hws_facility VARCHAR2(40), + type VARCHAR2(254), + ID NUMBER PRIMARY KEY NOT NULL +); +--Extent: (2539778.101933, 5456638.161347) - (2567463.841704, 5500605.745332) +INSERT INTO USER_SDO_GEOM_METADATA VALUES ('hws', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2539778.101933,2567463.841704,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5456638.161347,5500605.745332,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466); +CREATE OR REPLACE TRIGGER hws_trigger BEFORE INSERT ON hws FOR each ROW + BEGIN + SELECT HWS_ID_SEQ.nextval INTO :new.id FROM dual; + END; +/ +--/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'); + + + END;