Opened 16 years ago

Closed 16 years ago

#381 closed defect (fixed)

wxgui: Show attribute data depends on global db connection, not file db connection parameter

Reported by: mlennert Owned by: martinl
Priority: major Milestone: 6.4.0
Component: wxGUI Version: unspecified
Keywords: Cc: grass-dev@…
CPU: Unspecified Platform: Unspecified

Description

When trying to access the attribute table in the wxgui, I get an error when the map is connected to a table which is not in the default database of the mapset, in other words v.db.connect gives other information for database than db.connect. This is because db.tables is called.

Probably attribute management of a single map and table management for the default database need to be decoupled somehow...

Change History (6)

comment:1 by martinl, 16 years ago

Seems to work for me...

db.connect -p
driver:sqlite
database:$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db
schema:
group:
v.db.connect bz -g
1 bz cat /home/martin/grassdata/nc_spm_08/sqlite/sqlite.db sqlite
2 bz1 cat /home/martin/grassdata/nc_spm_08/sqlite/sqlite.db sqlite
3 p cat grass_test pg

No problem to display attribute data of 'bz' vector map in wxGUI. 'db.tables' is called on line 2460 in 'dbm' module with 'driver' and 'database' parameters. So I don't see any problem. Please correct me.

?

Martin

in reply to:  1 ; comment:2 by mlennert, 16 years ago

Replying to martinl:

Seems to work for me...

db.connect -p
driver:sqlite
database:$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db
schema:
group:
v.db.connect bz -g
1 bz cat /home/martin/grassdata/nc_spm_08/sqlite/sqlite.db sqlite
2 bz1 cat /home/martin/grassdata/nc_spm_08/sqlite/sqlite.db sqlite
3 p cat grass_test pg

No problem to display attribute data of 'bz' vector map in wxGUI. 'db.tables' is called on line 2460 in 'dbm' module with 'driver' and 'database' parameters. So I don't see any problem. Please correct me.

IIUC, your map is connected to the database which is the default database of the mapset ($GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db - assuming that you are in location nc_spm_08 and mapset sqlite). The problem I saw was when the map was connected to a database (and driver) different from the default setting. I'll try to come up with a reproducible scenario, but that won't be before Monday.

Moritz

in reply to:  2 comment:3 by martinl, 16 years ago

IIUC, your map is connected to the database which is the default database of the mapset ($GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db - assuming that you are in location nc_spm_08 and mapset sqlite). The problem I saw was when the map was connected to a database (and driver) different from the default setting. I'll try to come up with a reproducible scenario, but that won't be before Monday.

in my case, the third attribute table comes from PostgreSQL database.

comment:4 by mlennert, 16 years ago

Just checked again and the issue is actually that the db.connect parameters point to a non-existing database. That is why the db.tables call fails.

So, not sure if this is to be considered as a bug. On the other hand, it is an "inconvenience", if you have maps linked to different databases in your mapset and might be confusing, when the v.db.connect parameters work.

This is why I said: "Probably attribute management of a single map and table management for the default database need to be decoupled somehow..."

But maybe just a more explicit error message (e.g. "Please use db.connect to set database parameters"), might be helpful.

Leaving it open for now to keep it in mind, but if you want to close is as "worksforme" then that's fine with me.

Moritz

comment:5 by martinl, 16 years ago

Cc: grass-dev@… added
Owner: changed from grass-dev@… to martinl
Status: newassigned

Should be fixed in r34651 (6.4) and r34652 (7.0).

in reply to:  5 comment:6 by mlennert, 16 years ago

Resolution: fixed
Status: assignedclosed

Replying to martinl:

Should be fixed in r34651 (6.4) and r34652 (7.0).

Good solution. Thanks !

Moritz

Note: See TracTickets for help on using tickets.