I notice a probable problem parsing v.db.connect's -g output. An
extra term containing the layer-name (if present) is added to the
first data column. e.g. if layer 1 had the name "layer_name"
G> v.db.connect -g fields2 fs='|'
1/layer_name|fields2|cat|.../$MAPSET/dbf/|dbf
instead of
1|fields2|cat|.../$MAPSET/dbf/|dbf
see v.db.connect/main.c "if (fi->name) { fprintf( ..."
probably the solution is not too bad, just take the .split("/")[0]
term when dealing with column 1 in the GUI code.
I am not an expert in these things so I ask: under what conditions
would a vector DB layer have a name? Is it seen in the wild or is
it just an unused nice idea someone had?
This is not an issue for gis.m in 6.5. Layer output of v.db.connect
isn't used/parsed, as user's provided layer number is used.
I was not able to find any (easy to spot) way how to name a layer, but
IIRC there are some modules, that add a name to layer during it's
creation.
Maris.
2009/8/24, Hamish <hamish_b@yahoo.com>:
Hi,
I notice a probable problem parsing v.db.connect's -g output. An
extra term containing the layer-name (if present) is added to the
first data column. e.g. if layer 1 had the name "layer_name"
G> v.db.connect -g fields2 fs='|'
1/layer_name|fields2|cat|.../$MAPSET/dbf/|dbf
instead of
1|fields2|cat|.../$MAPSET/dbf/|dbf
see v.db.connect/main.c "if (fi->name) { fprintf( ..."
probably the solution is not too bad, just take the .split("/")[0]
term when dealing with column 1 in the GUI code.
I am not an expert in these things so I ask: under what conditions
would a vector DB layer have a name? Is it seen in the wild or is
it just an unused nice idea someone had?
I notice a probable problem parsing v.db.connect's -g output. An
extra term containing the layer-name (if present) is added to the
first data column. e.g. if layer 1 had the name "layer_name"
...
I am not an expert in these things so I ask: under what conditions
would a vector DB layer have a name? Is it seen in the wild or is
it just an unused nice idea someone had?
AFAICT, it is an unused nice idea that Radim had. The vector dblink functions in field.c support layer number and name, but I can't find a module that allows to set the layer name for a given layer number, it seems you have to hand-edit the dbln file. Vector modules don't allow (yet?) to select a layer by name instead of number. It is in Radim's vector TODO and I would like to add that functionality to GRASS7.