[Dive4elements-commits] [PATCH 2 of 2] Importer: Fix fieldname of "official" in the new feature and set it

Wald Commits scm-commit at wald.intevation.org
Fri Feb 15 15:04:02 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1360937028 -3600
# Branch dami
# Node ID 563ff8893d47ba0613b10abcc38bd48b97ac098d
# Parent  baa32f1df47da9b76d5b509dcbb130ca4ddf2c69
Importer: Fix fieldname of "official" in the new feature and set it
based on the filename as a fallback

diff -r baa32f1df47d -r 563ff8893d47 flys-backend/contrib/shpimporter/hws.py
--- 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"):


More information about the Dive4elements-commits mailing list