Mercurial > dive4elements > river
changeset 1250:660116539429
Added schema hws.
flys-backend/trunk@2734 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Bjoern Schilberg <bjoern@intevation.de> |
---|---|
date | Wed, 14 Sep 2011 09:49:18 +0000 |
parents | 735717961e0b |
children | f124c99077b5 |
files | flys-backend/ChangeLog flys-backend/doc/schema/oracle-spatial.sql |
diffstat | 2 files changed, 26 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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 <bjoern@intevation.de> + + * doc/schema/oracle-spatial.sql: Added schema hws. + 2011-09-14 Bjoern Schilberg <bjoern@intevation.de> * doc/schema/oracle-spatial.sql: Added schema cross_section_tracks.
--- 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;