changeset 5198:edba92337204

Log error if KM attribute is not set for fixpoints
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 08 Mar 2013 10:29:30 +0100
parents f0c47b4beded
children 29d79741c2fe
files flys-backend/contrib/shpimporter/fixpoints.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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"):

http://dive4elements.wald.intevation.org