Mercurial > dive4elements > river
changeset 3677:c37effda3655
Added 'path' attribute to each geo relation; adapted the shape importer to set the path for each feature.
flys-backend/trunk@5309 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 30 Aug 2012 09:51:04 +0000 |
parents | ae16bd95879e |
children | 6185c15efccf |
files | flys-backend/ChangeLog flys-backend/contrib/shpimporter/axis.py flys-backend/contrib/shpimporter/importer.py flys-backend/doc/schema/oracle-spatial.sql |
diffstat | 4 files changed, 24 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-backend/ChangeLog Thu Aug 30 08:59:50 2012 +0000 +++ b/flys-backend/ChangeLog Thu Aug 30 09:51:04 2012 +0000 @@ -1,3 +1,12 @@ +2012-08-30 Ingo Weinzierl <ingo@intevation.de> + + * contrib/shpimporter/importer.py: Set 'path' attribute for each feature. + + * contrib/shpimporter/axis.py: Also accept shapes with 'achse' in its name. + + * doc/schema/oracle-spatial.sql: Added 'path' attribute to each db + relation. + 2012-08-30 Ingo Weinzierl <ingo@intevation.de> * doc/documentation/de/importer-geodaesie.tex: Bugfixes and added hint.
--- a/flys-backend/contrib/shpimporter/axis.py Thu Aug 30 08:59:50 2012 +0000 +++ b/flys-backend/contrib/shpimporter/axis.py Thu Aug 30 09:51:04 2012 +0000 @@ -27,7 +27,7 @@ def isShapeRelevant(self, name, path): - return name == "achse" + return name == "achse" or name.find("achse") >= 0 def createNewFeature(self, featureDef, feat, **args):
--- a/flys-backend/contrib/shpimporter/importer.py Thu Aug 30 08:59:50 2012 +0000 +++ b/flys-backend/contrib/shpimporter/importer.py Thu Aug 30 09:51:04 2012 +0000 @@ -120,6 +120,7 @@ path=path) if newFeat is not None: + newFeat.SetField("path", path) newFeat = self.transform(newFeat) res = destLayer.CreateFeature(newFeat) if res is None or res > 0:
--- a/flys-backend/doc/schema/oracle-spatial.sql Thu Aug 30 08:59:50 2012 +0000 +++ b/flys-backend/doc/schema/oracle-spatial.sql Thu Aug 30 09:51:04 2012 +0000 @@ -6,6 +6,7 @@ river_id NUMBER(38), kind NUMBER(38) DEFAULT 0 NOT NULL, name VARCHAR(64), + path VARCHAR(256), ID NUMBER PRIMARY KEY NOT NULL ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('river_axes', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); @@ -25,6 +26,7 @@ river_id NUMBER(38), km NUMBER(6,3), name VARCHAR(64), + path VARCHAR(256), ID NUMBER PRIMARY KEY NOT NULL ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('river_axes_km', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); @@ -45,6 +47,7 @@ km NUMBER(38,12) NOT NULL, z NUMBER(38,12) DEFAULT 0 NOT NULL, name VARCHAR(64), + path VARCHAR(256), ID NUMBER PRIMARY KEY NOT NULL ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('cross_section_tracks', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); @@ -66,6 +69,7 @@ kind VARCHAR2(16) NOT NULL, z NUMBER(38,12) DEFAULT 0, name VARCHAR(64), + path VARCHAR(256), ID NUMBER PRIMARY KEY NOT NULL ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('lines', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); @@ -89,6 +93,7 @@ GEOM MDSYS.SDO_GEOMETRY, river_id NUMBER(38), name VARCHAR2(255), + path VARCHAR(256), ID NUMBER PRIMARY KEY NOT NULL ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('buildings', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); @@ -111,6 +116,7 @@ km NUMBER(38,11) NOT NULL, HPGP VARCHAR2(255), name VARCHAR(64), + path VARCHAR(256), ID NUMBER PRIMARY KEY NOT NULL ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('fixpoints', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); @@ -129,6 +135,7 @@ GEOM MDSYS.SDO_GEOMETRY, river_id NUMBER(38), name VARCHAR(64), + path VARCHAR(256), ID NUMBER PRIMARY KEY NOT NULL ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('floodplain', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); @@ -168,6 +175,7 @@ river_id NUMBER(38), area NUMBER(19,5), name VARCHAR2(255), + path VARCHAR(256), ID NUMBER PRIMARY KEY NOT NULL ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('CATCHMENT', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); @@ -188,6 +196,7 @@ hws_facility VARCHAR2(255), type VARCHAR2(255), name VARCHAR(64), + path VARCHAR(256), ID NUMBER PRIMARY KEY NOT NULL ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('hws', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); @@ -211,6 +220,7 @@ count NUMBER(38), area NUMBER(19,5), perimeter NUMBER(19,5), + path VARCHAR(256), id NUMBER PRIMARY KEY NOT NULL ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('floodmaps', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); @@ -230,6 +240,7 @@ river_id NUMBER(38), name VARCHAR(255), kind NUMBER(38), + path VARCHAR(256), id NUMBER PRIMARY KEY NOT NULL ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('hydr_boundaries', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); @@ -247,6 +258,7 @@ river_id NUMBER(38), name VARCHAR(255), kind NUMBER(38), + path VARCHAR(256), id NUMBER PRIMARY KEY NOT NULL ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('hydr_boundaries_poly', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467); @@ -265,6 +277,7 @@ GEOM MDSYS.SDO_GEOMETRY, river_id NUMBER(38), name VARCHAR(64), + path VARCHAR(256), id NUMBER PRIMARY KEY NOT NULL ); INSERT INTO USER_SDO_GEOM_METADATA VALUES ('gauge_location', 'GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',3282450,3912240,0.001),MDSYS.SDO_DIM_ELEMENT('Y',5248260,6100130,0.001),MDSYS.SDO_DIM_ELEMENT('Z',-100000,100000,0.002)), 31467);