I figured out a solution to my problem using R, which is posted below for any future user&#39;s benefit (though this is specific to my dataset, some changes will be needed).&nbsp; I would still like to know if it is possible in GRASS, though.&nbsp; Thanks,<br>
<br>Adam<br><br>###################&nbsp; This code intersects a set of points with any number of polygons (which may be overlapping)<br><br>library(sp);library(rgdal)<br>fires=readOGR(&quot;/media/Data/Work/Regional/CFR/FireAnalysis/FireData/fires_15072008&quot;,&quot;all_fires_07_08&quot;)&nbsp; #read in shapefile<br>
d=as.data.frame(cbind(slot(fires,&quot;data&quot;)[1,],point=1))&nbsp; #use first row as template, add &quot;point&quot; as placeholder to be filled later<br>nfires=nrow(slot(fires,&quot;data&quot;)) #get the number of polygons<br>
for(i in 1:nfires) {&nbsp; #loop through each polygon one at a time<br>&nbsp; d2=overlay(fires[i,],points)&nbsp; #do overlay of all points for each fire polygon (this may result in lots of NAs)<br>&nbsp; d2$point=as.factor((1:nrow(d2))+100)&nbsp; #add point ID - my point IDs start at 101 and go up, you will have to adjust this<br>
&nbsp; d=rbind(d,d2)&nbsp; #bind this polygon&#39;s overlay to the previous one<br>&nbsp; print(paste(i,&quot; out of &quot;,nfires))&nbsp; #print progress<br>}<br><br>d=d[-1,] #remove first line - used to start dataframe<br>d=d[!<a href="http://is.na">is.na</a>(d$FIREREFERE),] #get rid of all the NAs using a field that is always populated<br>
d2=merge(d,slot(points,&quot;data&quot;),by.x=&quot;point&quot;,by.y=&quot;Locality_n&quot;,all.x=T)&nbsp; #merge with point data to get point attributes for each point<br><br>#########################################<br><br><br>
<div class="gmail_quote">On Wed, Dec 10, 2008 at 9:13 AM, Adam Wilson <span dir="ltr">&lt;<a href="mailto:adammichaelwilson2@gmail.com">adammichaelwilson2@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Greetings all,<br><div class="gmail_quote"><div class="Ih2E3d"><br>Summary:&nbsp; I would like to request that the v.distance function be updated (with a flag?) to allow reporting of multiple categories in one layer.<br><br></div>
Example of why this can be important:<div class="Ih2E3d"><br>
I am working with historical forest fire data and want to extract histories for different points. &nbsp; I start with a shapefile that contains many (1000s) of polygons, many of which overlap in x-y space but vary over time (time information is in the attribute table). I could separate this into separate shapefiles (one for each year) prior to importing to GRASS, but this would result in almost 100 different layers and I would rather avoid it.&nbsp; When I import it into grass using v.in.ogr, it is topologically cleaned and the result is a layer of (intersected) polygons, many of which have multiple categories that link to the attribute table.&nbsp; For example, a single polygon could have burned in multiple years, so it is linked to multiple rows in the attribute table.&nbsp; These multiple categories are visible with &quot;v.category -g input=fire option=print&quot; which results in something like this:<br>


2452<br>2452/2540<br>2452/2526/2540/2543<br>2540/2575<br>2406/2420/2517/2563/2581/2584<br>2406/2420/2517/2563/2581<br>2416/2452/2536<br>Where each row is a unique polygon and the different elements are the various categories (rows in the attribute table) that are linked to it.&nbsp; So far so good.&nbsp; But what I want to do is extract the fire history for a number of points, but v.distance only reports the last category for each polygon (which in my case is usually only the most recent fire) and reports &quot;<b>WARNING: more cats of to_layer</b>.&quot;&nbsp; So there seems to be a hidden ID value for each polygon (which would correspond to the invisible row number in the output above) but I cannot seem to access it directly.&nbsp; If I could, then it would be possible to v.distance to that ID, then use the output above to link a given point to several fire records. &nbsp; <br>


<br></div>If v.distance was updated to include multiple categories in the same layer, I would be able to do this easily. This has been proposed before: <a href="http://www.mail-archive.com/grass-user@lists.osgeo.org/msg02056.html" target="_blank">http://www.mail-archive.com/grass-user@lists.osgeo.org/msg02056.html</a>.&nbsp; I would like to encourage this revision (though maybe with a -m flag so you could turn this feature on if wanted).&nbsp; It would ideally (for me) return a table with multiple records for each point, each with an attribute from the polygon layer.&nbsp; For example, something like this:<div class="Ih2E3d">
<br>

<br>point | fireyear<br>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1950<br>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1975<br>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2002<br>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1960<br>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1972<br>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1954<br><br>In the short term, does anyone have any ideas on how I can get&nbsp; extract this data?<br>


<br><br>Thanks for any ideas,<br><font color="#888888"><br>Adam Wilson<br><br></font></div></div>
</blockquote></div><br><br clear="all"><br>-- <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Adam Wilson<br> &nbsp; __o &nbsp; &nbsp; &nbsp; <a href="http://hydrodictyon.eeb.uconn.edu/people/wilson/">http://hydrodictyon.eeb.uconn.edu/people/wilson/</a><br> _`\&lt;,_ &nbsp; &nbsp; Department of Ecology and Evolutionary Biology<br>
(*)/ (*) &nbsp; &nbsp;BioPharm 223<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; University of Connecticut<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tel: 860.486.4157<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Adam.Wilson@UConn.edu<br>