Mercurial > dive4elements > river
changeset 1246:e334314e8eb2
Added schema buildings.
flys-backend/trunk@2724 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Bjoern Schilberg <bjoern@intevation.de> |
---|---|
date | Wed, 14 Sep 2011 07:20:26 +0000 |
parents | 0414181b0859 |
children | 6c6c5500d72d |
files | flys-backend/ChangeLog flys-backend/doc/schema/oracle-spatial.sql |
diffstat | 2 files changed, 25 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-backend/ChangeLog Wed Sep 14 06:57:28 2011 +0000 +++ b/flys-backend/ChangeLog Wed Sep 14 07:20:26 2011 +0000 @@ -1,3 +1,7 @@ +2011-09-14 Bjoern Schilberg <bjoern@intevation.de> + + * doc/schema/oracle-spatial.sql: Added schema buildings. + 2011-09-14 Bjoern Schilberg <bjoern@intevation.de> * doc/schema/oracle-spatial.sql: Fixed table river_axes_km.
--- a/flys-backend/doc/schema/oracle-spatial.sql Wed Sep 14 06:57:28 2011 +0000 +++ b/flys-backend/doc/schema/oracle-spatial.sql Wed Sep 14 07:20:26 2011 +0000 @@ -42,4 +42,25 @@ --/opt/gdal-1.8.0/bin/ogr2ogr -f OCI OCI:flys3/flys3@localhost km.shp -sql 'SELECT 1 AS river_id,km as km FROM km' -nln river_axes_km -append CREATE INDEX river_axes_km_spatial_idx ON river_axes_km(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=point'); +-- Geodaesie/Bauwerke/Wehre.shp +CREATE SEQUENCE BUILDINGS_ID_SEQ; +CREATE TABLE buildings( + OGR_FID NUMBER(38), + GEOM MDSYS.SDO_GEOMETRY, + river_id NUMBER(38), + name VARCHAR2(50), + ID NUMBER PRIMARY KEY NOT NULL +); +--Extent: (2540544.253718, 5456266.217464) - (2567747.834199, 5502557.982120) +INSERT INTO USER_SDO_GEOM_METADATA VALUES ('buildings', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2540544.253718,2567747.834199,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5456266.217464,5502557.982120,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466); +CREATE OR REPLACE TRIGGER buildings_trigger BEFORE INSERT ON buildings FOR each ROW + BEGIN + SELECT BUILDINGS_ID_SEQ.nextval INTO :new.id FROM dual; + END; +/ +--/opt/gdal-1.8.0/bin/ogr2ogr -f OCI OCI:flys3/flys3@localhost Wehre.shp -sql 'SELECT 1 AS river_id,Name as name FROM Wehre' -nln buildings -append +CREATE INDEX buildings_spatial_idx ON buildings(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE'); + + END; +