Mercurial > dive4elements > river
changeset 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 | f1c01fecf194 |
files | flys-backend/contrib/shpimporter/hws.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
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"):