[GRASS-user] Merging Boundaries and Centroids
micha at arava.co.il
Fri Mar 20 04:28:34 EDT 2009
peter.loewe at gmx.de wrote:
> I just got stuck with a seemingly simple task:
> Let's assume vector layer A holds bunch of boundaries (for example, some non-overlapping circles) without categories, while vector layer B contains points/centroids which have categories AND attributes (Soil type, etc).
> What's the recipe to blend the two layers A and B into a new layer C which consists of circles having centroids with soil type attributes ?
You can do this with v.patch, *provided* that both vectors have
equivalent attribute table columns. So first on your vector A run
v.db.addtable and use the ' colums="..." ' option to add the same
attribute columns as are in vector B. Now run v.patch with the -e
switch. You should end up with an output vector including boundaries
(with no cat and no attributes) and centroids with the attributes.
> This question is caused the fact that v.in.ascii has (for the moment) no option to import lines/areas with attributes beyond a category.
As far as I know, you should certainly be able to import attributes
using v.in.ascii. Again use the ' columns="..." ' option to define
columns in the vector which are equivalent to the attribute columns in
the ascii file. The attribs will again be attached to the *centroids*,
not the boundaries.
More information about the grass-user