[GRASS-dev] Re: terminology issues in grass7

Markus GRASS markus.metz.giswork at googlemail.com
Tue Jun 16 16:13:08 EDT 2009


CAD is just one example, OGR supports many different formats and
apparently it was decided by GDAL/OGR developers to use the term
"layers" in OGR whenever possible. Picking an example that suits best
doesn't really help here, rather an in depth analysis of all
OGR-supported formats and the use of the term "layer" by OGR. This
debate is also about how easy should GRASS vectors fit into the OGR
model, and if GRAS developers want to make it easier or more difficult.

The debate is essentially about seeking similarity to existing
terminology or coming up with something GRASS specific that has no
equivalent. I see it as a danger to say that GRASS vectors are very
different to any other OGR-supported format. If I would explain the
GRASS vector model to a new user, I would rather start first with
similarities, then moving to the differences. Regarding layers, you can
convert from OGR layer to GRASS layer and back, but GRASS layers can do
much more than most OGR layers. Start explaining on common ground and
common words is what I would suggest. It gets bad enough later on: areas
instead polygons but areas are topological meta-objects, boundaries vs.
lines, islands may or may not be holes, the difference between nodes and
vertices etc.

BTW, 0 is a valid category value. Cat 0 allows for "exact mapping from
OGR FID to GRASS cat" on the level of layers;-):

http://grass.osgeo.org/wiki/GRASS_7_ideas_collection#Vector
http://sourceforge.net/mailarchive/message.php?msg_name=340505ef0601170244n1b5fe25bhd0a3eba7342b78d4%40mail.gmail.com
https://trac.osgeo.org/grass/browser/grass/trunk/doc/vector/TODO see OGR
interface

Markus M


Michael Barton wrote:
> I understand your examples here. And GRASS layers can indeed appear to
> function as CAD layers--as a way to control what gets displayed and
> what doesn't (although it seems from the various test reported that
> there is inconsistency in what happens if a cat for an object is
> null/empty for a layer).
>
> However, in a CAD drawing, a particular vector object exists IN only 1
> layer. That is, the "layer" serves to identify a subset of objects; a
> particular object cannot simultaneously exist in more than one layer.
> In GRASS every vector object has ALL layers. Each "layer" is attached
> to all objects, regardless of whether the cat value for a particular
> object in a particular layer is null or has a value.
>
> CAD
>
> Layer 1 ____ ID 1
>              |___ ID 2
>
> Layer 2 ____ ID 3
>              |___ ID 4
>
> In CAD, displaying Layer 1 shows ID's 1 & 2; displaying Layer 2 shows
> ID's 3 & 4. You cannot show ID 1 in Layer 2 unless you move it to
> Layer 2, in which case it could no longer be displayed in Layer 1. You
> can make a copy, of course, but then you have another object (ID 5).
>
> GRASS
>
> ID 1 ____ Layer 1: cat = 1
>         |___ Layer 2: cat = 1
>
> ID 2 ____ Layer 1: cat = 1
>         |___ Layer 2: cat = 1
>
> ID 3 ____ Layer 1: cat =
>         |___ Layer 2: cat = 2
>
> ID 4 ____ Layer 1: cat =
>         |___ Layer 2: cat = 2
>
>
> In GRASS, displaying Layer 1 will show all objects for some vector
> topologies, and only ID 1 and 2 for other topologies. However, by
> putting values into cat for Layer 1, you can also display ID's 3 & 4
> for Layer 1. You can achieve the same effect by querying cat = 1 for
> Layer 2. The difference is that sometimes empty cats are displayed and
> sometimes they are not. To me this is kind of an automatic
> (inadvertent even) query. Some of this is only semantics, but I think
> we all agree that semantics can be important.
>
> Many users writing to the lists seem baffled by GRASS layers. They are
> complicated to explain whatever we name them. My opinion--completely
> unsupported by any systematic data and only by anecdotal
> experience--is that these would be more understandable to more users
> if we used a term that emphasized the database nature of this feature
> rather than a term that suggests that it is most similar to multiple
> geospatial data layers combined into one file--the vector equivalent
> of a geotiff.
>
> FWIW, each layer of a cake is baked separately and they are all put
> together at the end, like different geospatial data layers (AKA maps
> in GRASS). But the goodies (nuts, candies, etc) in one layer cannot
> also be simultaneously in more than one layer. Each layer has to have
> its own set of goodies (all the tastier).  ;-)
>
> Cheers
> Michael
>
> On Jun 16, 2009, at 6:58 AM, Moritz Lennert wrote:
>
>> On 16/06/09 14:29, Markus GRASS wrote:
>>> Moritz Lennert wrote:
>>>> All features without any cat value display in all layers. As Paul
>>>> mentioned, you have to explicitely use the cat= parameter to only
>>>> display features with cat values in that layer. It is debatable
>>>> whether there should be a flag to indicate "only show features with
>>>> cat values in the chosen layer", or whether this should actually be
>>>> the default with a flag indicating "also show features without cat
>>>> values". I think the first would be more appropriate and would be a
>>>> more convenient way than using cat=1-9999.
>>> It seems that this behaviour depends on the feature types defined with
>>> type option. In a quick test with the spearfish dataset, boundaries
>>> having no cats are always displayed by default, but if I select layer=2
>>> type=area instead of type=point,line,boundary,centroid,area,face, I get
>>> only the areas with a cat value in layer 2 and no boundaries, no lines,
>>> nothing else is displayed, and it is not necessary to use cat=1-9999.
>>
>> But how you deal with the situation I described, i.e. one boundary
>> segment of the polygons has a cat value in layer 2 ? I.e.
>>
>> GRASS 6.5.svn (spearfish60):~ > v.category testlayers option=report
>> Layer/table: 1/testlayers
>> type       count        min        max
>> point          0          0          0
>> line           0          0          0
>> boundary       0          0          0
>> centroid       2          1          2
>> area           0          0          0
>> all            2          1          2
>> Layer: 2
>> type       count        min        max
>> point          0          0          0
>> line           0          0          0
>> boundary       1          1          1
>> centroid       0          0          0
>> area           0          0          0
>> all            1          1          1
>>
>> d.vect testlayers layer=1
>> d.vect testlayers layer=2 type=boundary cat=1-9999 col=red width=3
>>
>> gives:
>> http://geog-pc40.ulb.ac.be/grass/misc/testlayers1.png
>>
>> I need to declare either the boundary type (or no type at all) to see
>> anything in layer 2, but then it shows all boundaries:
>>
>> http://geog-pc40.ulb.ac.be/grass/misc/testlayers2.png
>>
>> Moritz
>



More information about the grass-dev mailing list