[GRASS-user] Re: How to extract z-coordiante and write it into attribute table?

TimNorwey timmy_weyrer at live.at
Thu Mar 24 15:15:00 EDT 2011


So thank you all again for the time you spent in helping me. 

Now it works. I was really stupid and it was my fault.

When I was importing the .csv, for some reason I set "cat=3" all the time
and so my z-coordinate was taken as "cat". I guess the module converts the
decimal values to integer ones and so lot of categories were equal.

That could be the reason for the error message I had. It can be seen in the
screenshot in the post below (if someone cannot remember):
http://osgeo-org.1803224.n2.nabble.com/How-to-extract-z-coordiante-and-write-it-into-attribute-table-tp6199821p6201431.html

My workflow:

1)import csv
v.in.ascii -z fs=, in=/.../.../.../raw_3009139se.csv x=1 y=2 z=3
out=raw_139se

2) clip points to specified region (fyi)
v.select ain=raw_139se bin=campus_east out=clip_139se

3) add attribute table for vector
v.db.addtable map=clip_139se layer=1 table=clip_139se "columns=cat integer"

4) connect vector to attribute table
v.db.connect map=clip_139se layer=1 driver=dbf
database=/grass_db/location/mapset/dbf/ table=clip_139se key=cat -o

5) add columns to attribute table
v.db.addcol map=clip_139se layer=1 columns="x double precision, y double
precision, z double precision"

6) add coordinates to columns
v.to.db map=clip_139se opt=coor columns="x,y,z"

Thank you again!

Cheers,
Tim



--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/How-to-extract-z-coordiante-and-write-it-into-attribute-table-tp6199821p6205351.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list