-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Vector info bug #359 #364
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good and tested successfully locally!
@@ -65,7 +65,7 @@ def _execute(self): | |||
"flags": "h"} | |||
|
|||
pc["3"] = { | |||
"module": "v.info", | |||
"module": "v.db.connect", | |||
"inputs": {"map": vector_name + "@" + self.mapset_name}, | |||
"flags": "c"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really want to print types/names of table columns for the specified layer (default is layer 1) or rather print all map connection parameters for all layers, would be empty if there are no connections?
"flags": "c"} | |
"flags": "g"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anikaweinmann or @mmacata : The old case (v.info -c) also printed only type/names of the specified layer (default layer 1). Should we change it as @metzm suggested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think v.db.connect -c
is the one which is like it is now. So I would prefer this. The style of g
is anonther one than we have a breaking change, or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check with v.db.connect -g
if there are more than 1 layer/tables or no layers (count number of rows). If there is only one layer the output should be v.info -c
as before, by multiple layer/tables v.db.connect -g
should be inside the results. By no layer/table nothing has to be added to the results.
Open question: how to write this in the api docs.
A GRASS vector can have no database connection at all or one or several database connections, one possible connection for each layer. The common case is that a vector has one database connection, the corresponding layer is layer 1. For other cases Maybe introduce a new endpoint where the layer of a vector can be specified? |
Instead of a new endpoint for a vector layer, the syntax also recognized by TGIS could be used: |
#359: By changing v.info -c to v.db.connect -c, GRASS does not return an error for vector maps with missing table. Instead this message is printed: "Map <test_random_vect> is not connected to a database". Thus the endpoint does not return an error anymore.