diff 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
line wrap: on
line diff
--- a/flys-backend/contrib/shpimporter/utils.py	Thu Feb 14 17:45:13 2013 +0100
+++ b/flys-backend/contrib/shpimporter/utils.py	Fri Feb 15 11:51:58 2013 +0100
@@ -60,3 +60,30 @@
     except UnicodeDecodeError:
         # Probably European Windows names so lets try again
         return unicode.encode(unicode(path, "cp1252"), "UTF-8")
+
+WKB_MAP = {
+    ogr.wkb25Bit :                'wkb25Bit',
+    ogr.wkbGeometryCollection :   'wkbGeometryCollection',
+    ogr.wkbGeometryCollection25D :'wkbGeometryCollection25D',
+    ogr.wkbLineString :           'wkbLineString',
+    ogr.wkbLineString25D :        'wkbLineString25D',
+    ogr.wkbLinearRing :           'wkbLinearRing',
+    ogr.wkbMultiLineString :      'wkbMultiLineString',
+    ogr.wkbMultiLineString25D :   'wkbMultiLineString25D',
+    ogr.wkbMultiPoint :           'wkbMultiPoint',
+    ogr.wkbMultiPoint25D :        'wkbMultiPoint25D',
+    ogr.wkbMultiPolygon :         'wkbMultiPolygon',
+    ogr.wkbMultiPolygon25D :      'wkbMultiPolygon25D',
+    ogr.wkbNDR :                  'wkbNDR',
+    ogr.wkbNone :                 'wkbNone',
+    ogr.wkbPoint :                'wkbPoint',
+    ogr.wkbPoint25D :             'wkbPoint25D',
+    ogr.wkbPolygon :              'wkbPolygon',
+    ogr.wkbPolygon25D :           'wkbPolygon25D',
+    ogr.wkbUnknown :              'wkbUnknown',
+    ogr.wkbXDR :                  'wkbXDR'
+}
+
+def getWkbString(type):
+    return WKB_MAP.get(type) or "Unknown"
+

http://dive4elements.wald.intevation.org