[Fwd: Re: [GRASS-user] Re: grassuser Digest, Vol 11, Issue 18]

Jorge Echeverri jorge.echeverri at Stein.de
Fri Mar 16 07:15:39 EDT 2007


I had ask these questions to Maciek. For completeness I am sending them
again to the forum along with his answers and new questions:

I just imported:
> 
> #'X_COORDINATE Y_COORDINATE'
> L 2 1
> 3400630.04 5718486.603 1982 2.88
> 3400639.238 5718515.776 1982 2.88
> 1 1
> L 2 1
> 3400639.238 5718515.776 1982 3.77
> 3400648.641 5718546.057 1982 3.77
> 1 182
> L 2 1
> 3400648.641 5718546.057 1982 4.7
> 3400665.041 5718562.99 1982 4.7
> 1 181
> 
> both with and without -n and it worked in the same way.
> 
> But now I have a question. This file contains not only coordinates but
> also 2 attributes: "Year" and "Depth" in the columns 3 and 4. If I
> follow the instructions of v.in.ascii manual:
> 
> "The coordinates are listed following the initial line containing the
> primitive code, the total number of vectors in the series, and the
> number of categories (1 for a single layer, higher for multiple
layers).
> Below that 1 or several lines follow to indicate the layer number and
> the category number (ID)."
> 
> I rewrite my file like:
> 
> #'X_COORDINATE Y_COORDINATE'
> L 2 2
> 3400630.04 5718486.603 1982 2.88
> 3400639.238 5718515.776 1982 2.88

I don't think you can import vector in standard format together with
it's attributes using v.in.ascii. It's possible only for points format.
In standard format, the "1982 2.88" etc. after x,y coordinates are
discarded.

To add attributes to your lines vector created with v.in.ascii, you
would need to create the table separately (eg. a dbf with OO.org Calc
or OO.org Base, or using the db.execute to create the table and
populate it with values) and then attach it to your lines vector uisng
v.db.connect.

To understand how categories and layers work, please refer to the
"Vector data processing in GRASS GIS" chapter of the manual.

> 2 1
> L 2 2
> 3400639.238 5718515.776 1982 3.77
> 3400648.641 5718546.057 1982 3.77
> 1 182
> 2 182
> L 2 2
> 3400648.641 5718546.057 1982 4.7
> 3400665.041 5718562.99 1982 4.7
> 1 181
> 2 181
> 
> The last 2 in the first line for the number of attributes, isn't it? 
> And data are rightly imported:
> 
> Erzeuge Topologie ...
> 3 primitives registriert
> Building areas:  100%
> 0 Flächen erstellt
> 0 Inselflächen erstellt
> Füge Inselflächen hinzu:
> Füge Zentroide hinzu: 100%
> Die Topologie wurde erstellt.
> Anzahl von Knoten     :   4
> Anzahl von Primitives :   3
> Anzahl von Punkten    :   0
> Anzahl von Linien     :   3
> Anzahl von Boundaries :   0
> Anzahl von Zentroiden :   0
> Anzahl von Flächen    :   0
> Anzahl von Inseln     :   0
> 
> But I have to admit, I'm still confused with the concept of layer and
> category in GRASS; i.e., I wrote these lines:
> 1 182
> 2 182
> Like first line1 for Layer 1 and 182 from original line ID of my data
> and second line
> and second line for Layer 2 and 182 from original line ID of my data
> was this right?

You propbaly mean this part:

> L 2 2
> 3400648.641 5718546.057 1982 4.7
> 3400665.041 5718562.99 1982 4.7
> 1 181
> 2 181

If you wanted the given line, consinsted of 2 vertices, to have 2
attribute links (categories), one in the layer 1 and the other in layer
2, both with category number "182", you did it right.


Oh, I think I misunderstood the concept of category:

Actually, what I want to do is to create layers 1 and 2 for each line
and that those have attribute values in the fields "Year" and "Depth" in
the table below:

L 2 2
3400648.641 5718546.057 1982 4.7
3400665.041 5718562.99 1982 4.7
1 181
2 181

Table:
LineID    Year    Depth   
1             1982    2.88
182        1982    3.77
181        1982    4.7

So I guess, I have to import the line geometry like
   
 #'X_COORDINATE Y_COORDINATE'
L 2 1
3400630.04 5718486.603
3400639.238 5718515.776
1 2
2 3
L 2 1
3400639.238 5718515.776
3400648.641 5718546.057
1 2
2 3
L 2 1
3400648.641 5718546.057
3400665.041 5718562.99
1 2
2 3

Each line having layers 1 and 2 that connect to values in the categories
2 and 3.??

Or from the example in v.in.ascii manual is still not so clear what the
line below the data means???

ORGANIZATION: GRASS Development Team 
DIGIT DATE: 1/9/2005 
DIGIT NAME: - 
MAP NAME: test 
MAP DATE: 2005 
MAP SCALE: 10000 
OTHER INFO: Test polygons 
ZONE: 0 
MAP THRESH: 0.500000 
VERTI: 
B 6 1 
5958812.48844435 3400828.84221011 
5958957.29887089 3400877.11235229 
5959021.65906046 3400930.7458436 
5959048.47580612 3400973.65263665 
5959069.92920264 3401032.64947709 
5958812.48844435 3400828.84221011 
1 1 
B 4 1 
5959010.9323622 3401338.36037757 
5959096.7459483 3401370.54047235 
5959091.38259917 3401450.99070932 
5959010.9323622 3401338.36037757 
1 2

Does it mean that the first boundary has the layer 1 related to the
category with number ID 1 and the second boundary  has the layer 1
related to the category 2 with number ID? It doesn't make much sense.

and then use v.db.connect to assign the geometric entities with the
values in the table. But when I get through the v.db.connect  manual is
not clear to me how records and fields on the table are correctly
assigned to the respective lines??

Jorge

> On the other hand how can I classify and visualise these data with
> GRASS?

d.vect, d.vect.thematic

Both available via gis.m and d.m as well as from command line. There is
also QGIS which has nice thematic mapping capabilities and reads GRASS
vectors.

P.S.

Please don't ask question offlist. It's better to let others
participate.

Cheers,
Maciek
-- 
Jorge Echeverri, BSc Civ. Eng.
S & P CONSULT GMBH
Technologiequartier
Konrad-Zuse-Str. 6
D-44801 Bochum, Germany
Geschäftsführer: Dipl.-Ing. Robert Stein
Registergericht: Amtsgericht Bochum HRB 10769


Phone:    +49(0) 234 51 67 193
Fax:      +49(0) 234 51 67 109

Email:    jorge.echeverri at stein.de
Internet: www.stein.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20070316/e619541d/attachment.html


More information about the grass-user mailing list