Skip to content

geobuffers created with geobuffer_pts() do not contain all the lat/lon's that were used to created them? #1

@gabyrimok

Description

@gabyrimok

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions