[GRASSLIST:3652] Re: help on spatial join in GRASS 5.7

Radim Blazek blazek at itc.it
Thu Jun 10 03:28:17 EDT 2004


On Thursday 10 June 2004 07:33, Michael Barton wrote:
> I am trying to do a spatial join in GRASS 5.7 and am stuck.
>
> I am creating a file of vector areas from polylines using v.type, and a
> file of vector points that represent the centroids of those areas. I'd
> like to join the two vector maps such that the cat value of each point
> in the point file becomes the cat value (or at least A value) of the
> corresponding area in the vector area file. I assume that the vector
> 'areas' will actually be boundaries lacking centroids after I create
> them in v.type.
>
> I know how I would do it in GRASS 5.3, as well as in ArcView and
> MapInfo. I have a feeling that it is possible to do this in GRASS 5.7,
> but can't figure out which command to use and how to do it. Thanks.

Say that you have 2 inputs: 'lines', 'points'

v.patch input=lines,points output=areas1
v.type input=areas1 output=areas2 type=line,boundary,point,centroid

It may be that your lines are closed polygons, in that case you have to run also
v.clean input=areas2 output=areas3 tool=bpol,rmdupl,break,rmdupl

Radim




More information about the grass-user mailing list