[GRASS-user] Recategorize Multi-Part Vector Layer?

Markus Metz markus.metz.giswork at googlemail.com
Thu Apr 9 10:45:52 EDT 2009


Maybe this works, or at least points into the right direction:

- v.category: create a new layer for the dissolved vector where each 
area gets a unique category
- v.db.addtable: for the new layer to hold attributes (cats, comp no ...)
- v.to.db: load comp no (and any other attributes you want) from old 
layer to new layer
- v.to.db: upload area size to the new layer with unique cats where 
several cats can have the same comp no
- v.out.ogr as before, now using the new layer

The first step should make sure that area size is calculated for each 
area separately when using the new layer.
The exported shapefile will have a separate entry for each area anyway, 
so you can just as well prepare the attribute table accordingly in grass.

Hope that helps,
Markus M


Nemo wrote:
> I work for a county forest in n'rn Wisconsin.  The forest is about 200,000 acres.  It is divided into management blocks called compartments, averaging about 700 acres each.  The comps are then divided into their component stands, based on timber type, size, density, age, etc.
>
> I have the forest in a personal geodatabase in ArcView 9.x.  To help distribute the data to the other foresters, I output the vector data to a shapefile and add the table data to it, so all the data is in one table.
>
> AV doesn't support topology (and can really mess up boundaries betweeen adjoining polygons), so before joining the table data, I import the shapefile into GRASS to clean it up.  While the stands is in GRASS, I dissolve the stands to the comp number to make a comps layer.  I have GRASS compute the acreage of both layers, and then export to shapefiles.
>
> I have a short script that does it all for me, but have one small problem...  A handful of the comps are multi-part polygons.  GRASS calculates the acreage based on the cat number, and the cat number equals the comp number after the dissolve.  When it exports the shapefile, each polygon gets the total acreage of the comp.
>
> For example, comp 100 is made up of two polygons; one is 100 acres and the other is 400 acres.  In the shapefile, each polygon is 500 acres.
>
> How do I recategorize the comps layer so that it doesn't double-count the multi-part polygons?  I've tried a number of combinations with v.category, v.reclass, and v.db.*, but haven't found the right one.
>
> Thanks,
>
> Nemo
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
>   


More information about the grass-user mailing list