[Dive4elements-commits] [PATCH] removed obsolete importer code for catchments

Wald Commits scm-commit at wald.intevation.org
Wed Feb 27 15:49:19 CET 2013


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1361976555 -3600
# Branch dami
# Node ID 94ce92e7360327196e109c5f5a0e7316b0f92dd5
# Parent  c4b28de753dea932ba54525607af7163baff185c
removed obsolete importer code for catchments

diff -r c4b28de753de -r 94ce92e73603 flys-backend/contrib/shpimporter/catchments.py
--- a/flys-backend/contrib/shpimporter/catchments.py	Wed Feb 27 15:26:47 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-try:
-    from osgeo import ogr
-except ImportError:
-    import ogr
-
-from importer import Importer
-
-TABLE_NAME="catchment"
-PATH="Hydrologie/Einzugsgebiet"
-NAME="Catchments"
-
-
-class Catchment(Importer):
-
-    def getPath(self, base):
-        return "%s/%s" % (base, PATH)
-
-
-    def getTablename(self):
-        return TABLE_NAME
-
-
-    def getName(self):
-        return NAME
-
-
-    def isGeometryValid(self, geomType):
-        return geomType == 3 or geomType == 6
-
-
-    def isShapeRelevant(self, name, path):
-        return True
-
-
-    def createNewFeature(self, featureDef, feat, **args):
-        newFeat  = ogr.Feature(featureDef)
-        geometry = feat.GetGeometryRef()
-        geometry.SetCoordinateDimension(2)
-
-        newFeat.SetGeometry(geometry)
-
-        if self.IsFieldSet(feat, "river_id"):
-            newFeat.SetField("river_id", feat.GetField("river_id"))
-        else:
-            newFeat.SetField("river_id", self.river_id)
-
-        if self.IsFieldSet(feat, "Name"):
-            newFeat.SetField("name", feat.GetField("name"))
-        else:
-            newFeat.SetField("name", args['name'])
-
-        if self.IsFieldSet(feat, "AREA"):
-            newFeat.SetField("area", feat.GetField("area"))
-
-        return newFeat
-
diff -r c4b28de753de -r 94ce92e73603 flys-backend/contrib/shpimporter/run.sh
--- a/flys-backend/contrib/shpimporter/run.sh	Wed Feb 27 15:26:47 2013 +0100
+++ b/flys-backend/contrib/shpimporter/run.sh	Wed Feb 27 15:49:15 2013 +0100
@@ -20,7 +20,6 @@
 SKIP_HYDR_BOUNDARIES=0
 SKIP_HWS=0
 SKIP_GAUGE_LOCATION=0
-SKIP_CATCHMENTS=0
 SKIP_UESG=0
 
 exec python shpimporter.py \
@@ -41,6 +40,5 @@
     --skip_hydr_boundaries $SKIP_HYDR_BOUNDARIES \
     --skip_hws $SKIP_HWS \
     --skip_gauge_locations $SKIP_GAUGE_LOCATION \
-    --skip_catchments $SKIP_CATCHMENTS \
     --skip_uesgs $SKIP_UESG
 


More information about the Dive4elements-commits mailing list