I imported a large vector shapefile into grass. v.in.ogr did not report any errors. However, when I try to open the attribute table (Show attribute table in GUI dialog), I get an error saying “Inconsistent number of column in the table”. The Attribute table manager then opens but I can’t browse the data. However, table is correctly described (column names and data type).
From the CLI, v.db.select will print the contents of the attribute table without any complains.
I imported a large vector shapefile into grass. v.in.ogr did not report
any
errors. However, when I try to open the attribute table (Show attribute
table in GUI dialog), I get an error saying "Inconsistent number of column
in the table". The Attribute table manager then opens but I can't browse
the data. However, table is correctly described (column names and data
type).
From the CLI, v.db.select will print the contents of the attribute table
without any complains.
Any idea how to troubleshoot this?
are there any special characters in the table content, e.g. ' or " or ; or ,
or / or \ .... etc?
That is probably the case.
Is there a way to ‘sanitize’ this shapefile DBF prior to v.in.ogr?
Or the fact that v.db.select works on the CLI means that the attribute table is OK. It’s more a visualization problem with the GUI attribute table manager.
Thanks
Daniel
On Tue, Jan 16, 2018 at 6:15 PM Helmut Kudrnovsky <hellik@web.de> wrote:
DanielV wrote
Hi List,
I imported a large vector shapefile into grass. v.in.ogr did not report
any
errors. However, when I try to open the attribute table (Show attribute
table in GUI dialog), I get an error saying “Inconsistent number of column
in the table”. The Attribute table manager then opens but I can’t browse
the data. However, table is correctly described (column names and data
type).
From the CLI, v.db.select will print the contents of the attribute table
without any complains.
Any idea how to troubleshoot this?
are there any special characters in the table content, e.g. ’ or " or ; or ,
or / or \ … etc?
Sorry to resurface an old problem. At the time I was able to ‘circle around’ this ‘inconsistent number of column’ issue. But now it came back (like all good problems do).
Anyway, I imported a large soil map with v.in.ogr, whitout errors. But when I try to open the attribute table (Show attribute table in GUI dialog), I get an error saying “Inconsistent number of column in the table”. The Attribute table manager then opens but I can’t browse the data.
v.db.select on the CLI works fine so I suspect it’s a problem with special characters in the attribute table messing up with the attribute table GUI.
The data has lots of special characters (accents) and they show up fine in v.db.select. But I suspect the main problem is that the attribute table has line breaks! Yes, someone has placed line brakes in the attribute table. Yikes…
Any idea how to clean this attribute table? The only thing I could think of is opening the shapefile in R or Python and try to substitute the “\n” character.
That is probably the case.
Is there a way to ‘sanitize’ this shapefile DBF prior to v.in.ogr?
Or the fact that v.db.select works on the CLI means that the attribute table is OK. It’s more a visualization problem with the GUI attribute table manager.
Thanks
Daniel
On Tue, Jan 16, 2018 at 6:15 PM Helmut Kudrnovsky <hellik@web.de> wrote:
DanielV wrote
Hi List,
I imported a large vector shapefile into grass. v.in.ogr did not report
any
errors. However, when I try to open the attribute table (Show attribute
table in GUI dialog), I get an error saying “Inconsistent number of column
in the table”. The Attribute table manager then opens but I can’t browse
the data. However, table is correctly described (column names and data
type).
From the CLI, v.db.select will print the contents of the attribute table
without any complains.
Any idea how to troubleshoot this?
are there any special characters in the table content, e.g. ’ or " or ; or ,
or / or \ … etc?
On Tue, Jul 3, 2018 at 5:53 PM Micha Silver <tsvibar@gmail.com> wrote:
On 07/03/2018 10:39 PM, Daniel Victoria wrote:
Hi list,
Sorry to resurface an old problem. At the time I was able to ‘circle around’ this ‘inconsistent number of column’ issue. But now it came back (like all good problems do).
Anyway, I imported a large soil map with v.in.ogr, whitout errors. But when I try to open the attribute table (Show attribute table in GUI dialog), I get an error saying “Inconsistent number of column in the table”. The Attribute table manager then opens but I can’t browse the data.
v.db.select on the CLI works fine so I suspect it’s a problem with special characters in the attribute table messing up with the attribute table GUI.
The data has lots of special characters (accents) and they show up fine in v.db.select. But I suspect the main problem is that the attribute table has line breaks! Yes, someone has placed line brakes in the attribute table. Yikes…
Any idea how to clean this attribute table? The only thing I could think of is opening the shapefile in R or Python and try to substitute the “\n” character.
I think you can do this straight in sqlite (assuming your backend db for this vector is sqlite) using the builtin sql function replace().
Here’s an example:
sqlite> create table t1 (id integer primary key, label text); sqlite> insert into t1 (label) values ('ab ...> cd'); sqlite> insert into t1 (label) values ('xyz ...> abc'); sqlite> sqlite> select * from t1; 1|ab cd 2|xyz abc
Now the replace trick:
sqlite> update t1 set label=replace(label, ' ...> ', ''); sqlite> select * from t1; 1|ab cd 2|xyz abc sqlite>
That is probably the case.
Is there a way to ‘sanitize’ this shapefile DBF prior to v.in.ogr?
Or the fact that v.db.select works on the CLI means that the attribute table is OK. It’s more a visualization problem with the GUI attribute table manager.
Thanks
Daniel
On Tue, Jan 16, 2018 at 6:15 PM Helmut Kudrnovsky <hellik@web.de> wrote:
DanielV wrote
Hi List,
I imported a large vector shapefile into grass. v.in.ogr did not report
any
errors. However, when I try to open the attribute table (Show attribute
table in GUI dialog), I get an error saying “Inconsistent number of column
in the table”. The Attribute table manager then opens but I can’t browse
the data. However, table is correctly described (column names and data
type).
From the CLI, v.db.select will print the contents of the attribute table
without any complains.
Any idea how to troubleshoot this?
are there any special characters in the table content, e.g. ’ or " or ; or ,
or / or \ … etc?