Opened 11 years ago

Closed 11 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 Changed 11 years ago by 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.

?

Martin

comment:2 in reply to:  1 ; Changed 11 years ago by mlennert

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

comment:3 in reply to:  2 Changed 11 years ago by martinl

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 Changed 11 years ago by mlennert

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 Changed 11 years ago by martinl

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

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

comment:6 in reply to:  5 Changed 11 years ago by mlennert

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.