<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You can use v.distance with dmax=0 to do such a "spatial join" between polygons and points:<br>
<br>
v.db.addcolumn YourCentroids col='poly_cat int'<br>
v.distance from=YourCentroids to=YourPolygons upload=cat column=poly_cat dmax=0<br>
<br>
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.<br></blockquote><div></div></div></div></blockquote></div>
<div>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:</div>
<div><br></div><div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">ERROR 1: ERROR: permission denied for relation geography_columns</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">
<br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); "><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">ERROR 1: PostgreSQL driver doesn't currently support database creation.</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">
<span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">Please create database with the `createdb' command.</span></div>
<div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); "><br></span></div><div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">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.</span></div>
<div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); "><br></span></div><div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">Not too experienced with PostGIS, it's probably a newbie error... Anyway, that's where I'm at at the moment :)</span></div>