[GRASS-user] ouput centroids and areas_newbie

Moritz Lennert mlennert at club.worldonline.be
Fri Jan 9 11:49:53 EST 2009


On 09/01/09 17:29, Matthew Mulbrandon wrote:
> Hello,
> 
> New to Grass but not GIS.
> 
> I have imported shp file county block group data( tenn_county_new) into 
> a grass mapset. That part is working fine, projections match.
> 
> Now I want to output x y coord for all centroids, and areas (in meters) 
> into a table.
> 
> I can see centroids and area shows up in the identification so I know 
> its there somewhere.
> 
> Tried v.centriod, v.to.db and other options but still have no idea how 
> to do this.
> 
> Information in table that is
> 
> id
> cat
> ID (the first three match and just count up the number of blocks)
> FIPSSTCO
> tractGroup
> STFID
> 
> 
> 
> 
> Can anyone help?

Create columns to hold the information in your table with v.db.addcol, i.e.

v.db.addcol map=YourMap column="x double precision"

(repeat for y and area).

Then run v.to.db with

- option=area column=area units=YourChoice
- option=coor column=x,y type=centroid units=YourChoice

Then export table with db.out.ogr or just v.db.select redirected to a file.

Moritz



More information about the grass-user mailing list