Dear Joe, Maybe you could use a similar process that Marcelino suggested to me yesterday in order to compute the shortest distance from points to a polyline. You need to 1)convert your point data to ppp object in spatstat, 2)coerce your polygon data to a psp object in spatstat. 3)nncross between the two. You'll get "dist" - the nearest neighbour distance between the two patterns and "which" the nearest neighbour index of the second pattern. Maybe it won't be so straightforward to know which ids of the coerced polyline correspond to each polygon but I am not sure about this point. Best regards, Pilar
-----Mensaje original----- De: r-sig-geo-boun...@stat.math.ethz.ch en nombre de brwin...@aol.com Enviado el: jue 21/05/2009 21:14 Para: r-sig-geo@stat.math.ethz.ch Asunto: [R-sig-Geo] Finding the county shapefile polygon closest to along-lat position Greetings I have a large number of long-lat locations dispersed over the US and need to identify which US county that each point is located in (or nearest to). After reading the past posts and Roger's book, I have been able to use the overlay function to identify the appropriate counties for the set of locations with long-lats lying within or on a polygon boundary. However, due to longlat precision errors (I am assuming), some of the points lie outside all of my shapefile's county polygon boundaries. Is there an R function similar to "overlay" that I could use to find which county polygon is closest to each of my longlat points that do not lie within the shapefile's polygons? I have spent quite a bit of time searching and browsing past list discussions and can seem to find my answer. My apologies if I have missed an obvious answer. Joe **************Huge savings on HDTVs from Dell.com! (http://pr.atwola.com/promoclk/100126575x1221836042x1201399880/aol?redir=http:%2F%2Fad.doubleclick.ne t%2Fclk%3B215073686%3B37034322%3Bb) [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo La información contenida en este e-mail y sus ficheros adjuntos es totalmente confidencial y no debería ser usado si no fuera usted alguno de los destinatarios. Si ha recibido este e-mail por error, por favor avise al remitente y bórrelo de su buzón o de cualquier otro medio de almacenamiento. This email is confidential and should not be used by anyone who is not the original intended recipient. If you have received this e-mail in error please inform the sender and delete it from your mailbox or any other storage mechanism. [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo