[GRASS-user] Merging Boundaries and Centroids

Moritz Lennert mlennert at club.worldonline.be
Fri Mar 20 04:58:52 EDT 2009


On 20/03/09 09:28, Micha Silver wrote:
> peter.loewe at gmx.de wrote:
> 
>> hi,
>>
>> 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.

If you can use the append flag (-a) you don't need to have matching 
tables. Just v.patch -a input=LayerA output=LayerB.

>> 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.

 From the man page:

columns=name
     Column definition in SQL style (points mode)

So, not possible for lines/areas. I guess this is due to the more 
complicated file format for lines and areas which makes it difficult to 
integrate attributes.

Moritz


More information about the grass-user mailing list