[GRASS-user] Question about layers and categories

Vincent Bain bain at toraval.fr
Thu Apr 4 13:39:00 PDT 2013


Thank you Markus for your reply.
The least we can say is that my message was not very well stated, in
cause it reveals several questions... eventhough I was convinced to be
clear-minded about vector/database grass model !

So, let's put aside wxGUI-related questions. And go on with an example :
        v.to.points -v input=project output=test type=line

The result is a point vector with 2 layers :
        v.db.connect -p map=test
                Vector map <test at vincent> is connected by:
                layer <1> table <test_1> in database
                </home/vincent/Pro/toraval/cauterets2013/L2e/vincent/sqlite.db> through driver <sqlite> with key <cat>
                layer <2> table <test_2> in database
                </home/vincent/Pro/toraval/cauterets2013/L2e/vincent/sqlite.db> through driver <sqlite> with key <cat>

As I need to work with data from layer 2 only, I want to purge layer 1
(i.e. (i) its symbolic link to table test_1, (ii) the set of categories
attached to layer 1, and secondarily table test_1, but I can perform it
at the sqlite3 prompt, no problem). 
Your comment "Usually it does not harm to have categories attached to
geometries in multiple layers" suggests me to leave these unused
categories in place, isn't it ?

So I run 
        v.db.connect -d layer=1 map=test
        
and we have :
        v.db.connect -p map=test
                Vector map <test at vincent> is connected by:
                layer <2> table <test_2> in database
                </home/vincent/Pro/toraval/cauterets2013/L2e/vincent/sqlite.db> through driver <sqlite> with key <cat>

Practically ok, it can do the job. But all in all, what I am /unable/ to
properly do is to turn this layer <2> into a new layer <1> (and for that
I guess I first have to get rid of the former layer <1> categories).
Maybe it's a fancy of the mind but it would be rewarding for me to
succeed in it ;-)


Now, what about wxGUI ?
I agree with your comment "The wxGUI query ignores d.vect options and
will (should) report anything found in any layer." : the query tool
works quite well if you refer to results returned to command console,
but when no data is retrieved from layer <1>, the "update attributes"
popup does not appear, in other words, if you want to change layer <2>
attributes on the fly from the map display... you can't.

Thanks for your clarifications in the end, it confirms my initial idea
about this stuff.

Vincent.



More information about the grass-user mailing list