[GRASS-user] Newbie questions about GRASS data model details

Hello all,

I’m quite new to GRASS (coming from ESRI and MicroStation) and have two questions concerning the vector data model. I’ve read GRASS Wikis, manuals and other docs from the web, but I could not find comprehensive answers yet. Sorry for the long text … :slight_smile:

First question: how are the different type determinations for geometry objects saved in GRASS? What makes a boundary a boundary and separates it from a line? The same for points and centroids.

I’ve read about the theoretical differences (eg., boundaries are split at intersections and they make up closed rings). But those criteria can apply to lines as well.

Command v.type is able to convert those types of geometry objects. That is, lines can be converted to boundaries and vice versa. But how does the system determine if an object is a line or a boundary? Where is that property saved? Is there an invisible attribute column or flag that contains the information? And how and when is that determination changed (if not by v.type)?

Eg. when importing linestrings from DXF to GRASS with import option set to “centroid, boundary”, the importer will produce lines as well (it will do this where linestrings have dangling errors). That means that there must be an automated way (running in the background) of determining the geometry type. What are the rules it follows?? As you can see, it does not do what the user chooses in the import options that were set. If that was the case, no lines would come out, just boundaries.

Second: Up to now, I was not able to understand the concept of layers in GRASS. I’ve read a lot of explanations, most of them telling that a layer is a set of category values making up a different view to the underlying geometry objects. Using layers, the geometries can be aggregated or individually marked in a different, yet parallel manner at the same time.

But everything described in the manual or Wiki seems to me like one can do this using different attribute columns as well. IMHO, that applies even to the Wiki example that was just produced to show the advantage of the layer concept over attribute columns (example with field borders that are paths at the same time).

So question Nr. 2 is: what is the real advantage of the layer concept over a sophisticated set of attribute columns? And where is that layer structure saved physically? Can I make it visible? In the end, is it just a set of (most of the time invisible) columns??

Thanks and regards, Uwe

some of my naive understanding of the data model:

First question: how are the different type determinations for geometry

objects saved in GRASS? What >makes a boundary a boundary and separates it
from a line? The same for points and centroids.

taken from https://grass.osgeo.org/grass70/manuals/vectorintro.html

- point: a point;
- line: a directed sequence of connected vertices with two endpoints called
nodes;
- boundary: the border line to describe an area;
- centroid: a point within a closed ring of boundaries;
- area: the topological composition of a closed ring of boundaries and a
centroid;

an area is build upon boundaries and centroid; e.g. change line to
boundaries and point to centroid and build and area

Second: Up to now, I was not able to understand the concept of layers in

GRASS. I've read a lot of >explanations, most of them telling that a layer
is a set of category values making up a different view to >the underlying
geometry objects. Using layers, the geometries can be aggregated or
individually marked in >a different, yet parallel manner at the same time.

But everything described in the manual or Wiki seems to me like one can do

this using different attribute >columns as well.

just think of a line representing a road: e.g. layer 1 represents the road
type (e.g. small road ... highway), layer 2 holds the information if it's
allowed for bicycles; with the layer concept you doesn't need an attribute
table (but you can have also attribute tables in every layer) to hold
different characteristics of e.g. a line, boundary, point etc.

but obviously there is some overlapping between the layer and/or attribute
concept...

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Newbie-questions-about-GRASS-data-model-details-tp5257044p5257056.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Thu, Mar 17, 2016 at 3:14 PM, Uwe Fischer <gisfisch@t-online.de> wrote:

Hello all,

I'm quite new to GRASS (coming from ESRI and MicroStation) and have two
questions concerning the vector data model. I've read GRASS Wikis, manuals
and other docs from the web, but I could not find comprehensive answers
yet. Sorry for the long text ... :slight_smile:

First question: how are the different type determinations for geometry
objects saved in GRASS? What makes a boundary a boundary and separates it
from a line? The same for points and centroids.

I've read about the theoretical differences (eg., boundaries are split at
intersections and they make up closed rings). But those criteria can apply
to lines as well.

Command v.type is able to convert those types of geometry objects. That
is, lines can be converted to boundaries and vice versa. But how does the
system determine if an object is a line or a boundary? Where is that
property saved? Is there an invisible attribute column or flag that
contains the information? And how and when is that determination changed
(if not by v.type)?

Eg. when importing linestrings from DXF to GRASS with import option set to
"centroid, boundary", the importer will produce lines as well (it will do
this where linestrings have dangling errors). That means that there must be
an automated way (running in the background) of determining the geometry
type. What are the rules it follows?? As you can see, it does not do what
the user chooses in the import options that were set. If that was the case,
no lines would come out, just boundaries.

Second: Up to now, I was not able to understand the concept of layers in
GRASS. I've read a lot of explanations, most of them telling that a layer
is a set of category values making up a different view to the underlying
geometry objects. Using layers, the geometries can be aggregated or
individually marked in a different, yet parallel manner at the same time.

But everything described in the manual or Wiki seems to me like one can do
this using different attribute columns as well. IMHO, that applies even to
the Wiki example that was just produced to show the advantage of the layer
concept over attribute columns (example with field borders that are paths
at the same time).

So question Nr. 2 is: what is the real advantage of the layer concept over
a sophisticated set of attribute columns? And where is that layer structure
saved physically? Can I make it visible? In the end, is it just a set of
(most of the time invisible) columns??

GRASS uses a custom vector format which saves topology as a binary file. I
think v.build allows to dump the topology into a text file if you want to
see it. Also when you switch on vector digitizer, you can see the
difference between lines and boundaries. Attribute tables are not meant to
store geometry or topology.

Anna

Thanks and regards, Uwe

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On 17/03/16 20:14, Uwe Fischer wrote:

Hello all,

I'm quite new to GRASS (coming from ESRI and MicroStation) and have two
questions concerning the vector data model. I've read GRASS Wikis,
manuals and other docs from the web, but I could not find comprehensive
answers yet. Sorry for the long text ... :slight_smile:

First question: how are the different type determinations for geometry
objects saved in GRASS? What makes a boundary a boundary and separates
it from a line? The same for points and centroids.

I've read about the theoretical differences (eg., boundaries are split
at intersections and they make up closed rings). But those criteria can
apply to lines as well.

Command v.type is able to convert those types of geometry objects. That
is, lines can be converted to boundaries and vice versa. But how does
the system determine if an object is a line or a boundary? Where is that
property saved? Is there an invisible attribute column or flag that
contains the information? And how and when is that determination changed
(if not by v.type)?

Eg. when importing linestrings from DXF to GRASS with import option set
to "centroid, boundary", the importer will produce lines as well (it
will do this where linestrings have dangling errors). That means that
there must be an automated way (running in the background) of
determining the geometry type. What are the rules it follows?? As you
can see, it does not do what the user chooses in the import options that
were set. If that was the case, no lines would come out, just boundaries.

See
https://grass.osgeo.org/programming7/vectorlib.html
for details of the vector format.

The import routines often proceed to automatic checking and cleaning. There is some explanation in the v.in.ogr manual.

Second: Up to now, I was not able to understand the concept of layers in
GRASS. I've read a lot of explanations, most of them telling that a
layer is a set of category values making up a different view to the
underlying geometry objects. Using layers, the geometries can be
aggregated or individually marked in a different, yet parallel manner at
the same time.

But everything described in the manual or Wiki seems to me like one can
do this using different attribute columns as well. IMHO, that applies
even to the Wiki example that was just produced to show the advantage of
the layer concept over attribute columns (example with field borders
that are paths at the same time).

So question Nr. 2 is: what is the real advantage of the layer concept
over a sophisticated set of attribute columns? And where is that layer
structure saved physically? Can I make it visible? In the end, is it
just a set of (most of the time invisible) columns??

If you haven't done so, yet, make sure to read the vector intro in the manual:

https://grass.osgeo.org/grass70/manuals/vectorintro.html.

Generally, yes, you can handle most use cases with attributes. There are some situations where layers can come in handy.

Note that GRASS' vector format is somewhere between the classic GIS paradigm of one layer per file, and only one geometry type per file, and the dxf (or KML) paradigm of everything in one file. You can combine different geometry types in one file and using layers comes really handy then. See the whole network analysis toolbox for an example of such application.

Layers also allow you to link different attribute tables to the same features.

I would guess that except for network analyses, the majority of users stick to one single layer per map and use attributes.

Moritz