Opened 13 years ago

Last modified 12 years ago

#1633 closed defect

Unable to display shapefile attribute table due to pipe characters in dbf field — at Initial Version

Reported by: richardc Owned by: grass-dev@…
Priority: critical Milestone: 6.4.3
Component: wxGUI Version: svn-releasebranch64
Keywords: database, separator Cc:
CPU: Unspecified Platform: Unspecified

Description

Hi,

I'm receiving the following error on attempting to view the attribute table of shapefiles in GRASS 6.4.1.2 (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

Method: 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

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 table, including 'pipe' characters.

Example of problem fields in single column named 'VARNAME_1,C,150':

VARNAME_1,C,150

Bangkok|Krung Thep|Krung Thep Maha Nakhon|Phra Nakhon-Thonburi Buri Rum Chaxerngsao|Pad Rew|Paed Riu|Petrieu|Shajeun Dhrao Chainat Chantaburi|Muang Chan

NOTE: issue posted originally at http://osgeo-org.1560.n6.nabble.com/Index-error-Unable-to-show-attribute-table-of-shapefile-tp4678952p4678952.html

Change History (0)

Note: See TracTickets for help on using tickets.