[GRASS-SVN] r63610 - grass/trunk/gui/wxpython/gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Dec 19 02:41:51 PST 2014
Author: martinl
Date: 2014-12-19 02:41:51 -0800 (Fri, 19 Dec 2014)
New Revision: 63610
Modified:
grass/trunk/gui/wxpython/gui_core/dialogs.py
grass/trunk/gui/wxpython/gui_core/gselect.py
Log:
wxGUI: GDAL importer add support for GDAL RFC41 (Support for multiple geometry fields in OGR)
Modified: grass/trunk/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/dialogs.py 2014-12-19 10:28:48 UTC (rev 63609)
+++ grass/trunk/gui/wxpython/gui_core/dialogs.py 2014-12-19 10:41:51 UTC (rev 63610)
@@ -1889,6 +1889,10 @@
if self.importType == 'ogr':
if ext and layer.rfind(ext) > -1:
layer = layer.replace('.' + ext, '')
+ if '|' in layer:
+ layer, geometry = layer.split('|', 1)
+ else:
+ geometry = None
if self.link:
cmd = ['v.external',
'input=%s' % dsn,
@@ -1898,7 +1902,8 @@
cmd = ['v.in.ogr',
'input=%s' % dsn,
'layer=%s' % layer,
- 'output=%s' % output]
+ 'output=%s' % output,
+ 'geometry=%s' % geometry]
else: # gdal
if self.dsnInput.GetType() == 'dir':
idsn = os.path.join(dsn, layer)
@@ -2201,8 +2206,12 @@
if not self.IsChecked(item):
continue
# layer / output name
- data.append((self.GetItem(item, 1).GetText(),
- self.GetItem(item, self.GetColumnCount() - 1).GetText()))
+ layer = self.GetItem(item, 1).GetText()
+ ftype = self.GetItem(item, 2).GetText()
+ if '/' in ftype:
+ layer += '|%s' % ftype.split('/', 1)[0]
+ output = self.GetItem(item, self.GetColumnCount() - 1).GetText()
+ data.append((layer, output))
return data
Modified: grass/trunk/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/gselect.py 2014-12-19 10:28:48 UTC (rev 63609)
+++ grass/trunk/gui/wxpython/gui_core/gselect.py 2014-12-19 10:41:51 UTC (rev 63610)
@@ -1946,12 +1946,14 @@
layerId = 1
for line in ret.splitlines():
- layerName, featureType, projection = map(lambda x: x.strip(), line.split(','))
+ layerName, featureType, projection, geometryColumn = map(lambda x: x.strip(), line.split(','))
if projection == '0':
projectionMatch = _("No")
else:
projectionMatch = _("Yes")
grassName = GetValidLayerName(layerName)
+ if geometryColumn:
+ featureType = geometryColumn + '/' + featureType
data.append((layerId, layerName, featureType, projectionMatch, grassName))
layerId += 1
else:
More information about the grass-commit
mailing list