[Dive4elements-commits] [PATCH 2 of 3] Use latin1 as encoding in the dgm importer to make it easier matching latin1
Wald Commits
scm-commit at wald.intevation.org
Thu Apr 4 10:54:46 CEST 2013
# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1365063797 -7200
# Node ID 5b50247d4d99ffa4cce9a30263afcfcb3fa5b9a4
# Parent ed149d5d7fb7405736bc8306de6fb5745c229fc6
Use latin1 as encoding in the dgm importer to make it easier matching latin1
csv values
diff -r ed149d5d7fb7 -r 5b50247d4d99 flys-backend/contrib/shpimporter/dgm.py
--- a/flys-backend/contrib/shpimporter/dgm.py Wed Apr 03 16:33:28 2013 +0200
+++ b/flys-backend/contrib/shpimporter/dgm.py Thu Apr 04 10:23:17 2013 +0200
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: latin-1 -*-
import codecs
import utils
@@ -14,11 +14,11 @@
# <dbfield> : (<csvfield>, conversion function)
DGM_MAP = {
"projection" : "Projektion",
- "elevation_state" : latin("Höhenstatus"),
+ "elevation_state" : latin("Höhenstatus"),
"format" : "Format",
"border_break" : ("Bruchkanten",
lambda x: True if x.lower() == "Ja" else False),
- "resolution" : (latin("Auflösung"), lambda x: x),
+ "resolution" : (latin("Auflösung"), lambda x: x),
# "description" :
"srid" : "SRID",
"path" : ("Pfad_Bestand", lambda x: x),
@@ -111,7 +111,7 @@
for line in csvfile:
fields = line.split(";")
if not fields: continue
- if fields[namedict[latin("Gewässer")]] != \
+ if fields[namedict[latin("Gewässer")]] != \
unicode(utils.getUTF8(river_name),'UTF-8'):
continue
else:
More information about the Dive4elements-commits
mailing list