[Dive4elements-commits] [PATCH] Log error if KM attribute is not set for fixpoints

Wald Commits scm-commit at wald.intevation.org
Fri Mar 8 10:29:42 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1362734970 -3600
# Node ID edba92337204024054e3f8124e87a29814b6bf1d
# Parent  f0c47b4beded22c8bf7cfd20dc45a36c3dbd3b7f
Log error if KM attribute is not set for fixpoints

diff -r f0c47b4beded -r edba92337204 flys-backend/contrib/shpimporter/fixpoints.py
--- a/flys-backend/contrib/shpimporter/fixpoints.py	Fri Mar 08 10:16:21 2013 +0100
+++ b/flys-backend/contrib/shpimporter/fixpoints.py	Fri Mar 08 10:29:30 2013 +0100
@@ -4,6 +4,9 @@
     import ogr, osr
 
 from importer import Importer
+import logging
+logger = logging.getLogger("Fixpoints")
+fixpoints_no_km_logged=False
 
 TABLE_NAME="fixpoints"
 PATH="Geodaesie/Festpunkte"
@@ -49,6 +52,9 @@
         elif self.IsFieldSet(feat, "ELBE_KM"):
             newFeat.SetField("km", feat.GetFieldAsDouble("ELBE_KM"))
         else:
+            if not fixpoints_no_km_logged:
+                logger.error("Could not find KM attribute")
+                fixpoints_no_km_logged = True
             return None
 
         if self.IsFieldSet(feat, "X"):


More information about the Dive4elements-commits mailing list