[GRASS5] Re: [GRASSLIST:8871] Add perimeter length to table

Markus Neteler neteler at itc.it
Fri Nov 4 05:03:26 EST 2005


David,
(cc grass5)

On Thu, Nov 03, 2005 at 07:26:39PM -0800, David Finlayson wrote:
> In short I want to add the perimeter length of my vector
> areas/boundaries/shapes (whatever they are called) to the dbf table. I
> was able to add the area with v.to.db, but I am confused on how to do
> the perimeter.

Wolf has proposed patches to v.to.db which include the calculation
of perimeter. After some testing it will be available in GRASS 6.1-CVS.
Perhaps you could test? See his message on the developers list.
 
> In long, I am completely confused by the vector object model and I
> haven't been able to find a good explanation on the web (I probably
> missed it). Here are a few of my questions:
> 
> 1) What is the format of the vector file on disk (geometry, attributes, etc.)

Please have a look at the programmer's manual:

http://grass.itc.it/devel/index.php#prog

e.g.
 ->  GRASS 6 Programmer's Manual: HTML
      -> Related Pages
        -> GRASS 6 Vector Architecture

A couple of minutes ago I have added two general intro pages to
the GRASS included help system (will be online by next Saturday).
We will extend the page, also inspired by your questions. Volunteers
welcome to send text pieces.

See
 http://freegis.org/cgi-bin/viewcvs.cgi/grass6/raster/rasterintro.html
 http://freegis.org/cgi-bin/viewcvs.cgi/grass6/vector/vectorintro.html

(stored in 6.1-CVS).

> 2) What do grass terms like point, line, centroid, boundary, area,
> etc. mean exactly.

point: a point
line: a sequence of vertices connected by line(s) with two end nodes
boundary: the border line of an area
centroid: the label point of an area
area: the topological composition of centroid and boundary
face: a 3D area
kernel: a 3D centroid in a volume
volume: a 3D corpus

>  Are they used consistently throughout the manuals?

yes

> 3) What are the difference between categories and attributes (exactly)?

A category is a synonym for ID. Attributes are additional
information linked to the category (ID). 

> 4) What are layers?

It is possible to link a vector object to several tables.
The first table corresponds to the first layer. Further tables
are linked to subsequent layers.

> 5) How much of SQL is implemented in GRASS (presumably for dbf
> support) and how much is assumed from the back end (PostGRES, MySQL,
> etc.)?

DBF: very limited SQL support (as DBF is not an SQL DB)
Other DBs (PostgreSQL etc): full SQL support as the SQL sequence is sent
to the DB directly

> I could go on, for example the relationship of the SQL commands (db.*)
> to each other, 

please ask more specificly...

> the man page for v.to.db seems completely opaque to me.

Mhh. Detailed suggestions welcome.

> I feel like I missed a few weeks of class somewhere! That being said,
> it looks to me like the new vector model is not as well documented as
> the raster side of things.

That's possible since we have very limited forces. The more people
contribute (note that writing documentation does not necessarily require
programming skills), the faster things are well documented.


Markus

-- 
Markus Neteler     <neteler itc it>       http://mpa.itc.it
ITC-irst -  Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18        -       38050 Povo (Trento), Italy




More information about the grass-dev mailing list