[GRASS-user] Index error: Unable to show attribute table of shapefile

Hi,

I'm receiving the following error on attempting to view shapefiles in GRASS
6.4.1 (on Ubuntu Lucid):

item = layer, log = self.goutput)
  File "/usr/lib/grass64/etc/wxpython/gui_modules/dbm.py",
line 653, in __init__

self.__createBrowsePage()
  File "/usr/lib/grass64/etc/wxpython/gui_modules/dbm.py",
line 698, in __createBrowsePage

self.mapDBInfo, layer)
  File "/usr/lib/grass64/etc/wxpython/gui_modules/dbm.py",
line 95, in __init__

keyColumn = self.LoadData(layer)
  File "/usr/lib/grass64/etc/wxpython/gui_modules/dbm.py",
line 247, in LoadData

self.AddDataRow(i, record, columns, keyId)
  File "/usr/lib/grass64/etc/wxpython/gui_modules/dbm.py",
line 286, in AddDataRow

if self.columns[columns[j]]['ctype'] != types.StringType:
IndexError
:
list index out of range

Any suggestions would be welcome.

Thanks,
Richard

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Index-error-Unable-to-show-attribute-table-of-shapefile-tp4678952p4678952.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi Richard,

What’s the command you’re entering, or are you using your own script?

Best,
Daniel

B.Sc. Daniel Lee
Geschäftsführung für Forschung und Entwicklung
ISIS - International Solar Information Solutions GbR
Vertreten durch: Daniel Lee, Nepomuk Reinhard und Nils Räder

Deutschhausstr. 10
35037 Marburg
Festnetz: +49 6421 379 6256
Mobil: +49 176 6127 7269
E-Mail: Lee@isi-solutions.org
Web: http://www.isi-solutions.org

ISIS wird gefördert durch die Bundesrepublik Deutschland, Zuwendungsgeber: Bundesministerium für Wirtschaft und Technologie aufgrund eines Beschlusses des Deutschen Bundestages, sowie durch die Europäische Union, Zuwendungsgeber: Europäischer Sozialfonds.
Zusätzliche Unterstützung erhält ISIS von dem Entrepreneurship Cluster Mittelhessen, der Universität Marburg, dem Laboratory for Climatology and Remote Sensing und dem GIS-Lab Marburg.

Am 2. April 2012 15:35 schrieb RichardC <richtcooper@hotmail.com>:

Hi,

I’m receiving the following error on attempting to view shapefiles in GRASS
6.4.1 (on Ubuntu Lucid):

item = layer, log = self.goutput)
File “/usr/lib/grass64/etc/wxpython/gui_modules/dbm.py”,
line 653, in init

self.__createBrowsePage()
File “/usr/lib/grass64/etc/wxpython/gui_modules/dbm.py”,
line 698, in __createBrowsePage

self.mapDBInfo, layer)
File “/usr/lib/grass64/etc/wxpython/gui_modules/dbm.py”,
line 95, in init

keyColumn = self.LoadData(layer)
File “/usr/lib/grass64/etc/wxpython/gui_modules/dbm.py”,
line 247, in LoadData

self.AddDataRow(i, record, columns, keyId)
File “/usr/lib/grass64/etc/wxpython/gui_modules/dbm.py”,
line 286, in AddDataRow

if self.columns[columns[j]][‘ctype’] != types.StringType:
IndexError
:
list index out of range

Any suggestions would be welcome.

Thanks,
Richard


View this message in context: http://osgeo-org.1560.n6.nabble.com/Index-error-Unable-to-show-attribute-table-of-shapefile-tp4678952p4678952.html
Sent from the Grass - Users mailing list archive at Nabble.com.


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Hi Daniel,

I'm using the default menu items in GRASS.

I import the shapefile as follows:

Layer Manager > File > Import vector data > Common import formats > Select
ESRI shapefile > Browse and select file > Import

And then select the layer in 'Layer Manager', and click on the 'Show
attribute table' icon. Then the error results

'*Please wait loading attribute data..*' with the following in the command
console -

*if self.columns[columns[j]]['ctype'] != types.StringType:
IndexError
:
list index out of range
*

Perhaps related to upgrading from GRASS version 6.4.1.1 to 6.4.1.2. Maybe a
bug?

Thanks,
Richard

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Index-error-Unable-to-show-attribute-table-of-shapefile-tp4678952p4680945.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On closer inspection of the dbf file, some of the fields contain pipe (i.e.,
'|') characters. On removing these the attribute table can be displayed.

QGIS is able to display all data in the attribute, including 'pipe'
characters.

The question is, is this a bug in GRASS or should pipe characters not be
included in a shapefile dbf?

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Index-error-Unable-to-show-attribute-table-of-shapefile-tp4678952p4681140.html
Sent from the Grass - Users mailing list archive at Nabble.com.

I encountered the same problem some time ago. For me this seems a bug in
GRASS. At first I though this to be a SQLite problem, but I can import and
view tables with pipe symbols in my SQLite manager. I ended up replacing the
pipe symbols.

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Index-error-Unable-to-show-attribute-table-of-shapefile-tp4678952p4681205.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Have opened new ticket at http://trac.osgeo.org/grass/ticket/1633

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Index-error-Unable-to-show-attribute-table-of-shapefile-tp4678952p4681286.html
Sent from the Grass - Users mailing list archive at Nabble.com.