diff flys-backend/contrib/shpimporter/hws.py @ 5003:563ff8893d47 dami

Importer: Fix fieldname of "official" in the new feature and set it based on the filename as a fallback
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 15 Feb 2013 15:03:48 +0100
parents baa32f1df47d
children 769593a84606
line wrap: on
line diff
--- a/flys-backend/contrib/shpimporter/hws.py	Fri Feb 15 14:57:20 2013 +0100
+++ b/flys-backend/contrib/shpimporter/hws.py	Fri Feb 15 15:03:48 2013 +0100
@@ -138,9 +138,13 @@
             self.handled(fname)
             offiziell = feat.GetField(fname)
             if offiziell == "1" or offiziell == 1:
-                newFeat.SetField("offiziell", True)
+                newFeat.SetField("official", True)
             else:
-                newFeat.SetField("offiziell", False)
+                newFeat.SetField("official", False)
+        # Set the official value based on the file name as a fallback
+        elif args.get("name", "").lower() == "rohre_und_sperren" or \
+                args.get("name", "").lower() == "rohre-und-sperren":
+             newFeat.SetField("official", True)
 
         if self.IsFieldSet(newFeat, "z") and \
             self.IsFieldSet(newFeat, "rated_level"):

http://dive4elements.wald.intevation.org