On 30/01/2012 09:52, Shane Litherland wrote:
Hi all, I'm lost. I have looked around in GRASS for how to report the area (e.g. in hectares) for a vector map that, yes, has area (i.e. centroids and boundaries).I cannot find a way to do this. A bit of web searching, even gave some suggestions this basic facility may not be available in GRASS?? surely there's something tucked away to do it? I'm sure I've done something in the past to view vector area data, though it may have been area data that was already in a table. When I use the query tool in map display, it tells me 'nothing'. Seems that is because my vector is not connected to an attribute table. For the purpose of my exercise I did not need cats for the boundaries/centroids so I didn't bother with a table connection either. Maybe this is where I've gone wrong? I did try vector to raster to try and report on how many raster cells/area... no luck there either. I also tried the 'measure' tool in the map display, but it only gives distance. I could go and learn more about PostGIS for sending the vector data to a postgres geometry table and figure it out that way... I was hoping to find a way to do it in GRASS in a matter of minutes, not via a database and a couple of days/weeks of learning how... What tool/command should I be using? v.to.db is what you need. From the man page: Upload polygon areas to corresponding centroid record in the attribute table: v.to.db map=soils type=centroid option=area col=area_size unit=h You'll need to start by adding a database connection and a column for area. Again in the man page there's a sample you can follow- just use option=area instead of option=sides:Upload category numbers of left and right area, to an attribute table of boundaries common for the areas: # add categories for boundaries of the input vector map, in layer 2: v.category soils out=mysoils layer=2 type=boundary option=add # add a table with columns named "left" and "right" to layer 2 of the input # vector map: v.db.addtable mysoils layer=2 col="left integer,right integer" # upload categories of left and right areas: v.to.db mysoils option=sides col=left,right layer=2 # display the result: v.db.select mysoils layer=2 regards, Shane. _______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user This mail was received via Mail-SeCure System.
|
_______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
