[GRASS-user] calculating maximum and minimum diameters with, GRASS or R and GRASS?

Richard Chirgwin rchirgwin at ozemail.com.au
Mon Feb 15 17:22:32 EST 2010


 >Message: 5
 >Date: Sun, 14 Feb 2010 03:38:19 -0800 (PST)
 >From: Gazz1982 <garynobles at yahoo.com>
 >Subject: [GRASS-user] calculating maximum and minimum diameters with
 > GRASS or R and GRASS?
 >To: grass-user at lists.osgeo.org
 >Message-ID: <1266147499876-4569832.post at n2.nabble.com>
 >Content-Type: text/plain; charset=us-ascii
 >
 >
 >Hi,
 >
 >I have 900 polygons and I need to calculate their maximum and minimum
 >diameters I have GRASS and R and MySQL on Ubuntu, although my R skills are
 >still developing. I really do not want to measure each one by hand as I do
 >not have the time! I have managed easily to calculate perimeter and area,
 >anyone know how to do this?
 >
 >thanks
 >
 >Gary


Gary,

Use v.to.db, option=perimeter. This will upload the polygons' perimeters 
to a database table (you will need a perimeter column in the database, 
of course). From there, you can select the max and min with no trouble.

Hence:
v.db.addcol <map> columns="Perimeter double"
v.to.db <map> option=perimeter units=me column=Perimeter
v.db.select <map>

Richard


More information about the grass-user mailing list