[GRASS-user] grass vector model, cats and layers concept

Markus Metz markus.metz.giswork at gmail.com
Wed Jun 5 02:11:43 PDT 2013


On Wed, Jun 5, 2013 at 10:33 AM, Nikos Alexandris
<nik at nikosalexandris.net> wrote:
>
>
>> >> > and an example on how to create/connect to a *new* (empty) layer?
>
>
> Markus Metz wrote:
>
>> A new layer is created by adding categories in the new layer to vector
>> features. This has nothing to do with database connections. Therefore
>> you can by definition not create an empty layer.
>
>> In short,
>> create a new layer with v.category connect an existing table to a vector
>> layer with db.connect (the layer does not need to exist, a new layer will
>> not be created) create a new table for an existing layer with v.db.addtable
>
> Perfect, scratch all the rest then. Thank you Markus for clearing-up once
> again!
>
> Still, I find it counter-intuitive that it's required to create a new vector
> map to achieve that.
>
> --%<---
> v.category in=wrs2_tiles_of_interest_testing at PERMANENT layer=2 option=add
>
> ERROR: Output vector wasn't entered
> --->%--

Because you need to modify vector geometries in order to add a new
layer. Categories and layers are first and foremost stored together
with the geometries. Whenever geometries are modified, the result will
be a new vector map (with the exception of v.edit and the digitizers).

>
> An ignorant like me will probably ask himself:  I need a new layer in this
> map.  Why do I need to create an extra map?  For the records, related posts in
>
> <http://lists.osgeo.org/pipermail/grass-user/2013-May/068131.html>

The answer to this post would be v.reclass (which also modifies vector
geometries), or in a non-topological environment converting polygons
to mutlipolygons (which also modifies vector geometries).

Markus M
>
>
>> >> Could you provide one for me to add it?
>
>> > It works (also) for example by
> ..
>> > # add new layer by... !
>> > v.db.addtable wrs2_tiles_of_interest_testing layer=2
>
>> This does not add a new layer, it adds only a new connection. The
>> newly added table would be empty if there are no categories in the
>> given vector layer.
>
> O-K
>
>> > The other way, using "v.db.connect" (in G7) gives me the WARNING(s):
>
> [stuff deleted]
>
>> v.db.connect connects an existing table. If the specified table does
>> not exist, you get this warning, nothing wrong with that.
>
>> > Though, it creates the layer=3:
>
> [stuff deleted]
>
>> No, v.db.connect does not create a new layer, only a new connection.
>> You need to check with v.category if a layer exists. You can, however,
>> connect a table to a nonexisting layer with v.db.connect.
>
> Good.  But maybe we need to make it more clear why it is possible to create a
> (new) connection to something that does not exist yet?  The WARNINGS are
> correct. Still, connecting to something non-existing is rather confusing.
>
>> This is all illustrated in the picture mentioned earlier in this thread [0].
>> [0]
>> http://grasswiki.osgeo.org/wiki/Vector_Database_Management#Grass_vector_man
>> agement_model
>
> Cheers, Nikos


More information about the grass-user mailing list