[GRASS-user] Joining vectors by location

Daniel Lee lee at isi-solutions.org
Tue Nov 22 09:05:03 EST 2011

Hi there,

> You can use v.distance with dmax=0 to do such a "spatial join" between
> polygons and points:
> v.db.addcolumn YourCentroids col='poly_cat int'
> v.distance from=YourCentroids to=YourPolygons upload=cat column=poly_cat
> dmax=0
> This should upload the category values of your polygons to the attribute
> value of your centroids. If you then want to join the two tables, you can
> use v.db.join.

That sounds like a good idea, I'll try that out.

Hamish, I'm running 6.4RC1 from the Geo repository on OpenSUSE 11.4. Thanks
for the tip, though, I'll report back on the "spatial join" and if it
doesn't work with the polygons and points then I'll try compiling RC2. I'm
always kind of nervous about compiling stuff, but it's never quite as
painful as I think it'll be :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20111122/40850ab4/attachment.html

More information about the grass-user mailing list