Mercurial > dive4elements > river
comparison flys-backend/doc/schema/oracle-spatial.sql @ 1245:0414181b0859
Fixed table river_axes_km.
flys-backend/trunk@2723 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Bjoern Schilberg <bjoern@intevation.de> |
---|---|
date | Wed, 14 Sep 2011 06:57:28 +0000 |
parents | 281f38fc6c3e |
children | e334314e8eb2 |
comparison
equal
deleted
inserted
replaced
1244:281f38fc6c3e | 1245:0414181b0859 |
---|---|
21 END; | 21 END; |
22 / | 22 / |
23 --/opt/gdal-1.8.0/bin/ogr2ogr -f OCI OCI:flys3/flys3@localhost EZG.shp -sql 'SELECT 1 AS river_id,AREA as area, GEBIETZBEZ as name FROM EZG' -nln catchment -append | 23 --/opt/gdal-1.8.0/bin/ogr2ogr -f OCI OCI:flys3/flys3@localhost EZG.shp -sql 'SELECT 1 AS river_id,AREA as area, GEBIETZBEZ as name FROM EZG' -nln catchment -append |
24 CREATE INDEX catchment_spatial_idx ON catchment(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=polygon'); | 24 CREATE INDEX catchment_spatial_idx ON catchment(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('LAYER_GTYPE=polygon'); |
25 | 25 |
26 -- FIXME | |
27 -- Geodaesie/Flussachse+km/km.shp | 26 -- Geodaesie/Flussachse+km/km.shp |
28 CREATE SEQUENCE test_ID_SEQ; | 27 CREATE SEQUENCE RIVER_AXES_KM_ID_SEQ; |
29 CREATE TABLE test( | 28 CREATE TABLE river_axes_km( |
30 OGR_FID NUMBER(38), | 29 OGR_FID NUMBER(38), |
31 GEOM MDSYS.SDO_GEOMETRY, | 30 GEOM MDSYS.SDO_GEOMETRY, |
32 river_id NUMBER(38), | 31 river_id NUMBER(38), |
33 km NUMBER(6,3), | 32 km NUMBER(6,3), |
34 ID NUMBER PRIMARY KEY NOT NULL | 33 ID NUMBER PRIMARY KEY NOT NULL |
35 ); | 34 ); |
36 --Extent: (2539489.068000, 5450953.000500) - (2575482.527500, 5507278.634500) | 35 --Extent: (2539489.068000, 5450953.000500) - (2575482.527500, 5507278.634500) |
37 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('test', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2539490.068000,2575482.527500,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5450953.000500,5507278.634500,0.001)), 31466); | 36 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('river_axes_km', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',2539491.068000,2575482.527500,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5450953.000500,5507278.634500,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31466); |
38 CREATE TRIGGER test_trigger BEFORE INSERT ON test FOR each ROW | 37 CREATE OR REPLACE TRIGGER river_axes_km_trigger BEFORE INSERT ON river_axes_km FOR each ROW |
39 BEGIN | 38 BEGIN |
40 SELECT TEST_ID_SEQ.nextval INTO :new.id FROM dual; | 39 SELECT river_axes_km_ID_SEQ.nextval INTO :new.id FROM dual; |
41 END; | 40 END; |
42 / | 41 / |
43 --/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 test -nlt POINT -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 |
44 CREATE INDEX test_spatial_idx ON test(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'); |
45 --CREATE INDEX test_spatial_idx ON test(GEOM) indextype IS MDSYS.SPATIAL_INDEX parameters ('sdo_indx_dims=2,LAYER_GTYPE=point'); | |
46 | 44 |
47 END; | 45 END; |