[GRASS-user] v.db.connect -p

Markus Neteler neteler at osgeo.org
Tue Aug 3 15:01:21 EDT 2010


On Tue, Aug 3, 2010 at 12:21 PM, Markus Metz
<markus.metz.giswork at googlemail.com> wrote:
> Markus Neteler wrote:
>> Patricio Toledo wrote:
>>> Dear GRASS Developers
>>>
>>> This is a petition:
>>>
>>> Is it possible to add a option to v.db.connect (like g.region -p) so
>>> the output will be somelike:
>>>
>>>    $ v.db.connect -p map=test layer=2
>>>    driver=dbf
>>>    database=/the/database
>>>    table=thetable
>>>    column=thecolumn
>>>    layer=2
>>>
>>> i know -p actually does something very similar but this -p output is very useful
>>> in g.region, so one can do inside a shell-script:
>>>
>>>    $eval `v.db.connect -p map=test`
>>>
>>> to recover database connection parameters.
>>
>> There is -g
>>  -g   Print all map connection parameters and exit in shell script style
>>        Format: layer[/layer name] table key database driver
>> but it doesn't work as advertised (it is not shell script style!):
>>
>> v.db.connect -g map=streets_wake
>> 1 streets_wake cat /home/neteler/grassdata/nc_spm_08/PERMANENT/dbf/ dbf
>>
>> even with fs="=" it makes a mess:
>> v.db.connect -g map=streets_wake  fs="="
>> 1=streets_wake=cat=/home/neteler/grassdata/nc_spm_08/PERMANENT/dbf/=dbf
>>
>> Essentially, the line breaks are missing.
>> Should be a simple thing to fix.
>>
> try trunk r42980

Find attached a post-patch to reach the desired output as needed for "eval".

I have locally backported it to 6.4, too. But pls review the patch first.

Markus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v.db.connect_g7.diff
Type: application/octet-stream
Size: 1427 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20100803/3c998a20/v.db.connect_g7.obj


More information about the grass-user mailing list