diff flys-backend/contrib/shpimporter/boundaries.py @ 5512:b91ffd97edc8

Explicitly set sectie und sobek to 0 by default
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 28 Mar 2013 15:29:09 +0100
parents 4e166c514940
children 2cd8fcec3f00
line wrap: on
line diff
--- a/flys-backend/contrib/shpimporter/boundaries.py	Thu Mar 28 15:28:05 2013 +0100
+++ b/flys-backend/contrib/shpimporter/boundaries.py	Thu Mar 28 15:29:09 2013 +0100
@@ -59,9 +59,13 @@
         newFeat.SetField("kind", kind)
         if self.IsFieldSet(feat, "SECTIE"):
             newFeat.SetField("sectie", feat.GetField("SECTIE"))
+        else:
+            newFeat.SetField("sectie", 0)
 
         if self.IsFieldSet(feat, "SOBEK"):
             newFeat.SetField("sobek", feat.GetField("SOBEK"))
+        else:
+            newFeat.SetField("sobek", 0)
 
         if self.IsFieldSet(feat, "river_id"):
             newFeat.SetField("river_id", feat.GetField("river_id"))
@@ -102,10 +106,13 @@
 
         if self.IsFieldSet(feat, "SECTIE"):
             newFeat.SetField("sectie", feat.GetField("SECTIE"))
+        else:
+            newFeat.SetField("sectie", 0)
 
         if self.IsFieldSet(feat, "SOBEK"):
             newFeat.SetField("sobek", feat.GetField("SOBEK"))
-
+        else:
+            newFeat.SetField("sobek", 0)
 
         if self.IsFieldSet(feat, "river_id"):
             newFeat.SetField("river_id", feat.GetField("river_id"))

http://dive4elements.wald.intevation.org