You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I created thousands of buffers using coordinates (EPSG: 4269 (NAD83)) of the presences of amphibian species in North America with the geobuffer_pts function. The problem lies in when I try to randomly sample points within the buffers I created that are not presences of the species; many of the buffer coordinates do not contain any of the lat/lon coordinates of the species' presences used to create them, even when these coordinates and the buffer coordinates are rounded to the first, second, or third decimal place.
For one species (Anaxyrus fowleri), there are 792 presences. And 792 buffers were created accordingly. However, only 179 of these buffers contain the latitudes of this species presences and only 296 of these buffers' longitudes overlap with those of the species presences.
I am not really sure what is going on with the function for this to happen. Any thoughts?
Here is the code I used to run the buffer: buffer.pres.test <- geobuffer::geobuffer_pts(xy = a.fowleri.presences[,c("Longitude","Latitude")], dist_m = 517626.8, crs = "+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs", output = data.frame)
Here is the code I used to test for overlap in the coordinates between the resulting buffers and the presences of the species: which(round(a.fowleri.presences$Longitude, 2) == round(a.fowleri.20.buffer$lon, 2)) which(round(a.fowleri.presences$Latitude, 1) == round(a.fowleri.20.buffer$lat, 2))
The text was updated successfully, but these errors were encountered:
Hi @gabyrimok , I only saw this issue now. Perhaps you already solved this.
Unfortunately, at a fast look I do not understand the issue. If I understand this correctly, you wanted to test if certain point locations are within the buffer, then you need to do a spatial intersection - see the sf or sp packages for this.
The geobuffer package does one thing only - constructs geodesic buffers, but does not offer spatial operations. These are covered by the sf or sp packages.
Hello,
I created thousands of buffers using coordinates (EPSG: 4269 (NAD83)) of the presences of amphibian species in North America with the geobuffer_pts function. The problem lies in when I try to randomly sample points within the buffers I created that are not presences of the species; many of the buffer coordinates do not contain any of the lat/lon coordinates of the species' presences used to create them, even when these coordinates and the buffer coordinates are rounded to the first, second, or third decimal place.
For one species (Anaxyrus fowleri), there are 792 presences. And 792 buffers were created accordingly. However, only 179 of these buffers contain the latitudes of this species presences and only 296 of these buffers' longitudes overlap with those of the species presences.
I am not really sure what is going on with the function for this to happen. Any thoughts?
Here is some sample data to try see for yourself:
20_buffer_anaxyrus_fowleri.xlsx
a.fowleri.presences.xlsx
Here is the code I used to run the buffer:
buffer.pres.test <- geobuffer::geobuffer_pts(xy = a.fowleri.presences[,c("Longitude","Latitude")], dist_m = 517626.8, crs = "+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs", output = data.frame)
Here is the code I used to test for overlap in the coordinates between the resulting buffers and the presences of the species:
which(round(a.fowleri.presences$Longitude, 2) == round(a.fowleri.20.buffer$lon, 2)) which(round(a.fowleri.presences$Latitude, 1) == round(a.fowleri.20.buffer$lat, 2))
The text was updated successfully, but these errors were encountered: