ncbirdconservation / NCBA

A collaborative repository of code for the North Carolina Bird Atlas.
6 stars 2 forks source link

Function for tallying individuals counted by block #40

Closed nmtarr closed 2 years ago

nmtarr commented 2 years ago

observations_per_block <- function(records_df, blocks_sf, method){ # DRAFT DRAFT DRAFT Tallies the number of observations per block. Records_as_sf() produces input for this function.

Description: Although coordinates are provided by eBird for checklists, they do not provide precise locations of eBirder effort for two reasons. First, there are limits to the spatial precision of the points due to gps precision and/or observers ability to identify exactly where they birded on a map or in the app. Second, many birders travel while birding but their paths are not available, only the distances they traveled.

Locational uncertainty is important and problematic because if it is large in relation to the level of analysis, it creates uncertainty about which spatial subregions, such as counties or atlas blocks, an observation should be attributed to.

Parameters: records_sf -- a data frame of observations from EBD or the atlas cache.

blocks_sf -- a spatial data frame of atlas blacks

method -- specify the method to use for attributing observations to blocks. Choices are: "A", "B", "C", or "D", but method C is unavailable.

 Method A uses the block identified by eBird in the column "atlas_block".
     An abundance of empty values for atlas_block poses a problem.

 Method B assigns each observation to the block that the checklist
 coordinate is located within.  This approach could generate deceptive
 results if checklists represent birding effort from multiple blocks but
 are assigned to a single block or if the coordinate is located in a block
 adjacent to where the birding actually occurred.  This approach should
 generally be expected to underestimate how many checklists covered some
 portion of a given block.  Results are likely the same as with method A.

 Method C is currently unavailable.  It would involve acquiring checklist
 tracks and buffering them before intersecting with blocks.

 Method D uses polygons instead of the coordinates (points as in Method A) in
 order to include the locational uncertainty.  Under this approach,
 coordinates are buffered with the distance traveled by the observer
 during the checklist period, plus 100 m to account for the fact that
 observers may have recorded birds at a distance from where they were
 located.  Each checklist is then assigned to all of the blocks that the
 polygon intersects in order to acknowledge that the checklist could
 represent effort from multiple blocks. Results from this approach can
 logically be expected to exaggerate the true footprint of birding effort
 and suggest blocks were sampled that actually were not, thus overestimating
 how many checklists covered some portion of a given block.  Furthermore,
 checklists with large effort distances produce enormous footprints than make
 results unhelpful.  Thus, I excluded checklists with effort distances
 greater than 5 km for this method.

 Results:
 Spatial data frame of blocks with a tally of individuals reported