In that case I'd definitely look more at the over() function than that
ugly bit I suggested before.
Get your fish info into a SpatialPointsDataFrame
Since your polygons are in a SpatialPolygonsDataFrame, I would expect the
data frame part has one row per basin, and it contains the basin names or
I am looking at fish tagging data. I have gps coordinates of where each fish
was tagged and released, and I have a map of 10 coastal basins of the state
of Louisiana. I am trying to determine which basin each fish was tagged in.
--
View this message in context:
http://r.789695.n4.nabble.com/po
It would be useful to know what your ultimate goal is.
On Wed, May 22, 2013 at 6:29 AM, karengrace84 wrote:
> I am new to mapping with R, and I would like to use the point.in.polygon
> function from the sp package, but I am unsure of how to get my data in the
> correct format for the function. Th
First suggestion is to ask the question on r-sig-geo.
There is the over()
function in the sp package, though it may require you to put your points
in a spatial class object.
For a crude brute-force approach that does not easily generalize, but
might be the quickest short-term solution for you r
I am new to mapping with R, and I would like to use the point.in.polygon
function from the sp package, but I am unsure of how to get my data in the
correct format for the function. The generic form of the function is as
follows:
point.in.polygon(point.x, point.y, pol.x, pol.y, mode.checked=FALSE)
x <- sapply(c(1:max(greens[,1])), function() {
poly.x <- greens[greens[,1] == hole, 2]
poly.y <- greens[greens[,1] == hole, 3]
p.x <- gps[,3]
p.y <- gps[,4]
require(sp)
gps[which(point.in.polygon(p.x,p.y,poly.x,poly.y) != 0),ncol(gps)]
<- gps[which(point.in.polygon(p.x,p.y
6 matches
Mail list logo