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

Moritz Lennert mlennert at club.worldonline.be
Fri Mar 18 00:33:54 PDT 2016


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 ... :-)
>
> 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



More information about the grass-user mailing list