changeset 6815:e68e414dceb2 double-precision

Geo-importer: remove leftovers of catchment and gauge location importers
author Tom Gottfried <tom.gottfried@intevation.de>
date Mon, 12 Aug 2013 08:16:13 +0200
parents e41059fb4073
children a3c4f094707e
files backend/contrib/run_geo.sh backend/contrib/shpimporter/gauges.py backend/contrib/shpimporter/shpimporter.py
diffstat 3 files changed, 0 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- a/backend/contrib/run_geo.sh	Sat Aug 10 12:25:58 2013 +0200
+++ b/backend/contrib/run_geo.sh	Mon Aug 12 08:16:13 2013 +0200
@@ -19,8 +19,6 @@
 SKIP_HYDR_BOUNDARIES=0
 SKIP_HWS_LINES=0
 SKIP_HWS_POINTS=0
-SKIP_GAUGE_LOCATION=0
-SKIP_CATCHMENTS=0
 SKIP_UESG=0
 SKIP_DGM=0
 SKIP_JETTIES=0
@@ -65,7 +63,6 @@
     --skip_buildings $SKIP_BUILDINGS \
     --skip_floodplains $SKIP_FLOODPLAINS \
     --skip_hydr_boundaries $SKIP_HYDR_BOUNDARIES \
-    --skip_gauge_locations $SKIP_GAUGE_LOCATION \
     --skip_uesgs $SKIP_UESG \
     --skip_hws_lines $SKIP_HWS_LINES \
     --skip_hws_points $SKIP_HWS_POINTS \
--- a/backend/contrib/shpimporter/gauges.py	Sat Aug 10 12:25:58 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-try:
-    from osgeo import ogr
-except ImportError:
-    import ogr
-
-from importer import Importer
-
-TABLE_NAME="gauge_location"
-PATH="Hydrologie/Streckendaten"
-NAME="Gauge locations"
-
-
-class GaugeLocation(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 == 1
-
-
-    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"))
-        elif self.IsFieldSet(feat, "MPNAAM"):
-            newFeat.SetField("name", feat.GetField("MPNAAM"))
-        else:
-            newFeat.SetField("name", args['name'])
-
-        return newFeat
-
--- a/backend/contrib/shpimporter/shpimporter.py	Sat Aug 10 12:25:58 2013 +0200
+++ b/backend/contrib/shpimporter/shpimporter.py	Mon Aug 12 08:16:13 2013 +0200
@@ -17,7 +17,6 @@
 from floodplains import Floodplain
 from boundaries import HydrBoundary, HydrBoundaryPoly
 from hws import HWSLines, HWSPoints
-from gauges import GaugeLocation
 from jetties import Jetties
 from dgm import insertRiverDgm
 from floodmarks import Floodmark
@@ -47,7 +46,6 @@
         HydrBoundaryPoly(river_id, dbconn, dry_run),
         HWSLines(river_id, dbconn, dry_run),
         HWSPoints(river_id, dbconn, dry_run),
-        GaugeLocation(river_id, dbconn, dry_run),
         Jetties(river_id, dbconn, dry_run),
         Floodmark(river_id, dbconn, dry_run),
         UESG(river_id, dbconn, dry_run)
@@ -73,7 +71,6 @@
     parser.add_option("--skip_floodplains", type="int")
     parser.add_option("--skip_hws_lines", type="int")
     parser.add_option("--skip_hws_points", type="int")
-    parser.add_option("--skip_gauge_locations", type="int")
     parser.add_option("--skip_kms", type="int")
     parser.add_option("--skip_uesgs", type="int")
     parser.add_option("--skip_dgm", type="int")
@@ -125,8 +122,6 @@
     elif config.skip_hws_points == 1 and isinstance(importer, HWSPoints) and \
             not isinstance(importer, HWSLines):
         return True
-    elif config.skip_gauge_locations == 1 and isinstance(importer, GaugeLocation):
-        return True
     elif config.skip_jetties == 1 and isinstance(importer, Jetties):
         return True
     elif config.skip_kms == 1 and isinstance(importer, KM):

http://dive4elements.wald.intevation.org