[GRASS-user] [GRASSLIST:1113] layers in vector datasets

(sorry if this is a bit of a cross post, but i put a similar question under v.net.steiner. since not everyone may realize its really a layer question i figure’d id repost and ask)

can someone simplify an explanation about layers in grass vectors?
i read about them on this page. http://www.geog.uni-hannover.de/grass/grass61/manuals/html61_user/vectorintro.html
its under the “attribute management” section. it seems like they have more to do with linking tables?

The reason i ask, is because i’m trying to input to the v.net.steiner function without success. the function (as i understand it) requires inputs of arc layer, and point layer, but all in same file.

when opening the “network” grass vector in QGIS, it reveals that there are 3 layers. (which were built using v.patch to put them all together.)
layer 0 (arcs) = lines connecting buildings to streets
layer 1 (arcs) = streets
layer 1 (point) = buildings

because you specify the a(rc)layer and n(ode)layer, the fact that i have arcs in two layers seems like it is causing the function to bail.

is there a way to put all the arcs on one layer? or is there something else taht i am missing. layers in vector data models are a foreign concept to me coming from the a/i workstation world.

any help or clarification would be great! thanks in advance.

I can't answer your specific question, but I think I can answer the general one.

Vector layers in GRASS lingo are equivalent to "joined" tables in
ArcGIS. In GRASS the geometry information is stored in the file system
and attributes are stored in a database. The key linking the geometry
to the table is the category (often abbreviated to cat). The category
is equivalent to the Shapefile ObjectID.

You can have multiple tables linked to a single vector file hence the
layer=number terminology.

Tools which work with the linkage between the vector and the attribute
table begin with:

v.db.*

Whereas, tools that work strictly with the database table are prefaced with:

db.*

In many cases, the db.* commands can be replaced by SQL calls sent
directly to your database via conventional interfaces/GUI (nothing to
do with grass).

On 6/17/06, M S <mseibel@gmail.com> wrote:

(sorry if this is a bit of a cross post, but i put a similar question under
v.net.steiner. since not everyone may realize its really a layer question i
figure'd id repost and ask)

can someone simplify an explanation about layers in grass vectors?
i read about them on this page.
http://www.geog.uni-hannover.de/grass/grass61/manuals/html61_user/vectorintro.html
its under the "attribute management" section. it seems like they have more
to do with linking tables?

The reason i ask, is because i'm trying to input to the v.net.steiner
function without success. the function (as i understand it) requires inputs
of arc layer, and point layer, but all in same file.

when opening the "network" grass vector in QGIS, it reveals that there are
3 layers. (which were built using v.patch to put them all together.)
layer 0 (arcs) = lines connecting buildings to streets
layer 1 (arcs) = streets
layer 1 (point) = buildings

because you specify the a(rc)layer and n(ode)layer, the fact that i have
arcs in two layers seems like it is causing the function to bail.

is there a way to put all the arcs on one layer? or is there something else
taht i am missing. layers in vector data models are a foreign concept to me
coming from the a/i workstation world.

any help or clarification would be great! thanks in advance.

--
David Finlayson

excellent. thank you for the clarification. the parallels to the the esri software help too, since thats the world i’m migrating away from (after 10 years).

so you have layers that can be linked to various tables. if one does a v.patch command and now has two “layers” of lines, how can they both be put on the same layer, or does that not even matter? i guess its like if you have a polygon coverage in workstation. then u can build it for lines (the .aat) and polygons (the .pat). then u can add attributes and manipulate them for the different attribute tables. however, since u cant have various “layers” of the same datatype in a coverage, i think that is where i get confused.

in trying to run this v.net.steiner, i have lines on seperate layers. not sure if that is throwing the fucntion for a loop because you have to specify the layer of arcs.

thanks for the help.

On 6/18/06, David Finlayson <david.p.finlayson@gmail.com> wrote:

I can’t answer your specific question, but I think I can answer the general one.

Vector layers in GRASS lingo are equivalent to “joined” tables in
ArcGIS. In GRASS the geometry information is stored in the file system
and attributes are stored in a database. The key linking the geometry
to the table is the category (often abbreviated to cat). The category
is equivalent to the Shapefile ObjectID.

You can have multiple tables linked to a single vector file hence the
layer=number terminology.

Tools which work with the linkage between the vector and the attribute
table begin with:

v.db.*

Whereas, tools that work strictly with the database table are prefaced with:

db.*

In many cases, the db.* commands can be replaced by SQL calls sent
directly to your database via conventional interfaces/GUI (nothing to
do with grass).

On 6/17/06, M S < mseibel@gmail.com> wrote:

(sorry if this is a bit of a cross post, but i put a similar question under
v.net.steiner. since not everyone may realize its really a layer question i
figure’d id repost and ask)

can someone simplify an explanation about layers in grass vectors?
i read about them on this page.
http://www.geog.uni-hannover.de/grass/grass61/manuals/html61_user/vectorintro.html
its under the “attribute management” section. it seems like they have more
to do with linking tables?

The reason i ask, is because i’m trying to input to the v.net.steiner
function without success. the function (as i understand it) requires inputs
of arc layer, and point layer, but all in same file.

when opening the “network” grass vector in QGIS, it reveals that there are
3 layers. (which were built using v.patch to put them all together.)
layer 0 (arcs) = lines connecting buildings to streets
layer 1 (arcs) = streets
layer 1 (point) = buildings

because you specify the a(rc)layer and n(ode)layer, the fact that i have
arcs in two layers seems like it is causing the function to bail.

is there a way to put all the arcs on one layer? or is there something else
taht i am missing. layers in vector data models are a foreign concept to me
coming from the a/i workstation world.

any help or clarification would be great! thanks in advance.


David Finlayson

On 6/18/06, M S <mseibel@gmail.com> wrote:

so you have layers that can be linked to various tables.

Yes, you are correct. Only in GRASS the world "layer" is (confusingly)
used to refer to linkage (relation) between the vector map and the
attribute table. So, translating your statement above into GRASS. You
can have one vector map linked via "layers" to multiple attribute
tables.

if one does a
v.patch command and now has two "layers" of lines, how can they both be put
on the same layer, or does that not even matter?

I think all that means is that you have two attribute tables joined to
your single line vector.

i guess its like if you
have a polygon coverage in workstation. then u can build it for lines (the
.aat) and polygons (the .pat). then u can add attributes and manipulate
them for the different attribute tables. however, since u cant have various
"layers" of the same datatype in a coverage, i think that is where i get
confused.

In my opinion that is a mis-feature (having different attribute tables
for boundary lines and areas), but I think you can do it in GRASS too
if you want.

in trying to run this v.net.steiner, i have lines on seperate layers. not
sure if that is throwing the fucntion for a loop because you have to specify
the layer of arcs.

I can't help you with this. I haven't used the tool.

--
David Finlayson

excellent. thank you for the clarification. the parallels to the the esri
software help too, since thats the world i'm migrating away from (after 10
years).

perhaps a useful addition to this wiki page?

http://grass.gdf-hannover.de/wiki/Tips_for_Arc_users

Hamish

M S wrote:

so you have layers that can be linked to various tables. if one does
a v.patch command and now has two "layers" of lines, how can they both
be put on the same layer, or does that not even matter? i guess its
like if you have a polygon coverage in workstation. then u can build
it for lines (the .aat) and polygons (the .pat). then u can add
attributes and manipulate them for the different attribute tables.
however, since u cant have various "layers" of the same datatype in a
coverage, i think that is where i get confused.

if you have two vectors with dissimilar tables, v.patch won't/can't do
it.

The "-e" flag was recently added to v.patch to try.

see also the v.append script on the GRASS Wiki Add-ons page:
  http://grass.gdf-hannover.de/wiki/GRASS_AddOns#Vector_add-ons

v.append was written before the v.patch "-e" flag.

There's an example of a module which will result in 2 layer output, but
I can't remember what it is right now.

Hamish

after i work through this problem and understand whats going on, i would love to add to the wiki page for arc users. its grinding out the function now for v.net.steiner, with a county wide dataset for streets, and 208 steiner points its got some computing to do! Go GRASS & Linux!

can anyone explain why one would want or use arcs on different layers in the same grass vector dataset? i cant think of how this would be used.

On 6/19/06, Hamish <hamish_nospam@yahoo.com> wrote:

M S wrote:

so you have layers that can be linked to various tables. if one does
a v.patch command and now has two “layers” of lines, how can they both
be put on the same layer, or does that not even matter? i guess its
like if you have a polygon coverage in workstation. then u can build
it for lines (the .aat) and polygons (the .pat). then u can add
attributes and manipulate them for the different attribute tables.
however, since u cant have various “layers” of the same datatype in a
coverage, i think that is where i get confused.

if you have two vectors with dissimilar tables, v.patch won’t/can’t do
it.

The “-e” flag was recently added to v.patch to try.

see also the v.append script on the GRASS Wiki Add-ons page:
http://grass.gdf-hannover.de/wiki/GRASS_AddOns#Vector_add-ons

v.append was written before the v.patch “-e” flag.

There’s an example of a module which will result in 2 layer output, but
I can’t remember what it is right now.

Hamish

more questions on layers (perhaps overflowing into v.patch)…

i did a v.patch of some points, street lines, and lines that connect the points to streets. then i did the v.clean to snap and break the new node points.

when i query by mouse on the display, the streets from the v.patch output, i get somethings i dont understand:

  1. it doesnt seem that v.clean is doing any snapping or breaking. i click on a street line (in the v.patch output file) and it shows one line where the other line feature was patched in to connect to the streets. i would have expected a node and a break in the line to occur? i used v.clean with the point and line features and a threshhold of .1.

  2. in the v.patch output, when i click on the street lines, it comes up in the FORM box (under the map, mapset, feature type, length) Layer: 1, category: 75, Database connection not defined. at this point i intentionally dont have any database connections defined, as i’m just trying to get a simple geometric network to run through v.net.steiner.

  3. in the v.patch output, when i click on the lines connecting the points to the streets, there is no information in the FORM that comes up. I do get the map, mapset, feature type, length). in QGIS this shows as line feature, layer 0. the streets show as line feature, layer 1.

any reason why after v.patch i get the lines on different layers?

On 6/19/06, M S <mseibel@gmail.com> wrote:

after i work through this problem and understand whats going on, i would love to add to the wiki page for arc users. its grinding out the function now for v.net.steiner, with a county wide dataset for streets, and 208 steiner points its got some computing to do! Go GRASS & Linux!

can anyone explain why one would want or use arcs on different layers in the same grass vector dataset? i cant think of how this would be used.

On 6/19/06, Hamish < hamish_nospam@yahoo.com> wrote:

M S wrote:

so you have layers that can be linked to various tables. if one does
a v.patch command and now has two “layers” of lines, how can they both
be put on the same layer, or does that not even matter? i guess its
like if you have a polygon coverage in workstation. then u can build
it for lines (the .aat) and polygons (the .pat). then u can add
attributes and manipulate them for the different attribute tables.
however, since u cant have various “layers” of the same datatype in a
coverage, i think that is where i get confused.

if you have two vectors with dissimilar tables, v.patch won’t/can’t do
it.

The “-e” flag was recently added to v.patch to try.

see also the v.append script on the GRASS Wiki Add-ons page:
http://grass.gdf-hannover.de/wiki/GRASS_AddOns#Vector_add-ons

v.append was written before the v.patch “-e” flag.

There’s an example of a module which will result in 2 layer output, but
I can’t remember what it is right now.

Hamish