On 17/06/09 14:58, Roger Miller wrote:
The "layer=" feature of the commands seems to me to be largely if not
entirely superfluous. The function that it performs can be duplicated
by "where="
This would mean mixing different types of objects into the same layer and thus the same attribute table. I.e. in the field boundaries = roads example, you would have to use the same table for the centroids characterising the fields and for the boundary line which (also) represents a road.
Not very clean in my understanding...
and/or "catlist=".
But this supposes that the user knows the cats, which often is not the case, and it eliminates the possibility of linking different types of objects to different attribute tables.
So, neither of these would really replace the current layer feature.
Further, the term "layer" is widely used
with other meanings in fields where GIS is applied and that leads to
confusion.
As has already been said, "layer" is used in different ways, even within the GIS world. The OGR definition of layers is not really identical to the definition used by some softwares. The choice in GRASS at the time was to attempt to stick as close to the OGR definition as possible, while providing, withing GRASS, additional possible uses of layers.
Just to make this more visual:
d.vect testlayers2 layer=1 fcol=green
d.vect testlayers2 layer=2 fcol=red icon=basic/circle size=10
d.vect testlayers2 layer=3 col=blue width=5 type=line
giving you
http://geog-pc40.ulb.ac.be/grass/misc/layer_example.png
This is the "classical" CAD model. Main advantage: you only have to carry around one vector map, instead of three and you might be able to more easily work out topology between the different features (although I'm not sure this is true). But I agree that the advantages of this usage are debatable and one can argue that splitting up the three "themes" into three separate maps is cleaner.
However, consider this example:
d.vect testlayers3 layer=1 -c
d.vect testlayers3 layer=2 cat=1 width=3 col=blue
d.vect testlayers3 layer=3 size=10 type=point icon=basic/circle fcol=green
which gives you:
http://geog-pc40.ulb.ac.be/grass/misc/layer_example2.png
Here, the boundary between the two fields in layer 1 is also part of the path with cat 1 in layer 2. Or, said the other way around, it is the path which defines the boundary between the two fields.
Now, when this path is diverted, thus also changing the form of the field, you only have to move this line once to get something like this:
http://geog-pc40.ulb.ac.be/grass/misc/layer_example3.png.
This example highlights the use of layers for ensuring data integrity, i.e. making sure that the path is always the same line as the boundary.
You will notice that I have not used any attribute tables in this example.
I think one of the problems is that many people are used to shapefiles and thus think of layers as separate files, each containing different types of objects, but that is a very restrictive, data-format driven understanding of layers and falls apart as soon as you look at DXF, DGN or (AFAIU) Tiger files.
Moritz