[GRASS-user] add columns for x and y coordinates to vector db

Otto Dassau otto.dassau at gmx.de
Wed Apr 23 02:10:40 EDT 2008


Hi Brandon,

On Tue, 22 Apr 2008 22:22:52 -0700
"Brandon M. Gabler" <bgabler at email.arizona.edu> wrote:

> I have searched the archives, but cannot seem to find the answer.
> 
> I have a vector file, with 700 sites. I want to add columns for  
> x_coord and y_coord (or easting and northing, or whatever), so that  
> the columns represent the centroid coordinates of each site in the  
> vector database. So, for CAT #1, I want the column 'easting' to  
> update with the easting of CAT #1, and the column 'northing' to  
> update with the northing for CAT #1, and so on for all CAT numbers in  
> my file. I'm sure there is an easy script for v.db.update, but wanted  
> to check with the list before reinventing the wheel. Has anyone  
> created a script for such a thing, or is there a command within GRASS  
> that I'm missing?

you can use v.db.addcol to create two new attribute columns for x and y and then
use v.to.db with the option 'coor'.

regards,
 Otto

> Thanks,
> Brandon



More information about the grass-user mailing list