comparison 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
comparison
equal deleted inserted replaced
5002:baa32f1df47d 5003:563ff8893d47
136 fname = self.searchField("offiziell$") 136 fname = self.searchField("offiziell$")
137 if self.IsFieldSet(feat, fname): 137 if self.IsFieldSet(feat, fname):
138 self.handled(fname) 138 self.handled(fname)
139 offiziell = feat.GetField(fname) 139 offiziell = feat.GetField(fname)
140 if offiziell == "1" or offiziell == 1: 140 if offiziell == "1" or offiziell == 1:
141 newFeat.SetField("offiziell", True) 141 newFeat.SetField("official", True)
142 else: 142 else:
143 newFeat.SetField("offiziell", False) 143 newFeat.SetField("official", False)
144 # Set the official value based on the file name as a fallback
145 elif args.get("name", "").lower() == "rohre_und_sperren" or \
146 args.get("name", "").lower() == "rohre-und-sperren":
147 newFeat.SetField("official", True)
144 148
145 if self.IsFieldSet(newFeat, "z") and \ 149 if self.IsFieldSet(newFeat, "z") and \
146 self.IsFieldSet(newFeat, "rated_level"): 150 self.IsFieldSet(newFeat, "rated_level"):
147 fname = self.searchField("freibord(_m){0,1}$") 151 fname = self.searchField("freibord(_m){0,1}$")
148 self.handled(fname) 152 self.handled(fname)

http://dive4elements.wald.intevation.org