[GRASS-user] Joining vectors by location
lee at isi-solutions.org
Thu Nov 24 03:47:42 EST 2011
> 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
>> 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.
> Alright, I tried that out and it worked pretty well. At least the spatial
join - the table join didn't work because I'm working with GRASS' native
vector format, which apparently uses DBF. I'm currently trying to upload
the data into my PostGIS DB to do the next step, but I'm having some
trouble there - I get the following error when using v.out.ogr:
ERROR 1: ERROR: permission denied for relation geography_columns
ERROR 1: PostgreSQL driver doesn't currently support database creation.
Please create database with the `createdb' command.
Which is strange, because I'm the owner of the database and it exists
already. I've already checked to make sure I'm the owner of the tables too.
Not too experienced with PostGIS, it's probably a newbie error... Anyway,
that's where I'm at at the moment :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the grass-user