comparison flys-backend/contrib/shpimporter/utils.py @ 4995:998b29c8d2fd dami

Improve debug output for unsupported features and skipped shapefiles
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 15 Feb 2013 11:51:58 +0100
parents a6ee62a070b0
children 769593a84606
comparison
equal deleted inserted replaced
4993:71e1b96f4794 4995:998b29c8d2fd
58 try: 58 try:
59 return unicode.encode(unicode(path, sys.getfilesystemencoding()), "UTF-8") 59 return unicode.encode(unicode(path, sys.getfilesystemencoding()), "UTF-8")
60 except UnicodeDecodeError: 60 except UnicodeDecodeError:
61 # Probably European Windows names so lets try again 61 # Probably European Windows names so lets try again
62 return unicode.encode(unicode(path, "cp1252"), "UTF-8") 62 return unicode.encode(unicode(path, "cp1252"), "UTF-8")
63
64 WKB_MAP = {
65 ogr.wkb25Bit : 'wkb25Bit',
66 ogr.wkbGeometryCollection : 'wkbGeometryCollection',
67 ogr.wkbGeometryCollection25D :'wkbGeometryCollection25D',
68 ogr.wkbLineString : 'wkbLineString',
69 ogr.wkbLineString25D : 'wkbLineString25D',
70 ogr.wkbLinearRing : 'wkbLinearRing',
71 ogr.wkbMultiLineString : 'wkbMultiLineString',
72 ogr.wkbMultiLineString25D : 'wkbMultiLineString25D',
73 ogr.wkbMultiPoint : 'wkbMultiPoint',
74 ogr.wkbMultiPoint25D : 'wkbMultiPoint25D',
75 ogr.wkbMultiPolygon : 'wkbMultiPolygon',
76 ogr.wkbMultiPolygon25D : 'wkbMultiPolygon25D',
77 ogr.wkbNDR : 'wkbNDR',
78 ogr.wkbNone : 'wkbNone',
79 ogr.wkbPoint : 'wkbPoint',
80 ogr.wkbPoint25D : 'wkbPoint25D',
81 ogr.wkbPolygon : 'wkbPolygon',
82 ogr.wkbPolygon25D : 'wkbPolygon25D',
83 ogr.wkbUnknown : 'wkbUnknown',
84 ogr.wkbXDR : 'wkbXDR'
85 }
86
87 def getWkbString(type):
88 return WKB_MAP.get(type) or "Unknown"
89

http://dive4elements.wald.intevation.org