comparison flys-backend/doc/schema/oracle-spatial.sql @ 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
comparison
equal deleted inserted replaced
1245:0414181b0859 1246:e334314e8eb2
40 END; 40 END;
41 / 41 /
42 --/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 42 --/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
43 CREATE INDEX river_axes_km_spatial_idx ON river_axes_km(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=point'); 43 CREATE INDEX river_axes_km_spatial_idx ON river_axes_km(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=point');
44 44
45 -- Geodaesie/Bauwerke/Wehre.shp
46 CREATE SEQUENCE BUILDINGS_ID_SEQ;
47 CREATE TABLE buildings(
48 OGR_FID NUMBER(38),
49 GEOM MDSYS.SDO_GEOMETRY,
50 river_id NUMBER(38),
51 name VARCHAR2(50),
52 ID NUMBER PRIMARY KEY NOT NULL
53 );
54 --Extent: (2540544.253718, 5456266.217464) - (2567747.834199, 5502557.982120)
55 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);
56 CREATE OR REPLACE TRIGGER buildings_trigger BEFORE INSERT ON buildings FOR each ROW
57 BEGIN
58 SELECT BUILDINGS_ID_SEQ.nextval INTO :new.id FROM dual;
59 END;
60 /
61 --/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
62 CREATE INDEX buildings_spatial_idx ON buildings(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=LINE');
63
64
45 END; 65 END;
66

http://dive4elements.wald.intevation.org