Skip to content

Add clip information to metadata while preprocessing. #226

@ethanplunkett

Description

@ethanplunkett

Flag

  • metadata$clip$clipped logical flag to indicate that it is clipped.
  • is_clipped() function to return flag value if it exists and NA if it doesn't exist.

Clipped area

Possibly save data on clipping polygon. Considerations:

  • Do not use terra's vector format as it contains pointers/environments that will break things.
  • sf objects might be OK but I'd like to avoid any additional internal classes.
  • Could save the clip in raster (matrix) format with cells that align with the output projection. I liked this until I realized that we'd only retain the part of the clip that overlaps the specie's distribution.
  • Possibly save just the polygon's point coordinates in the final CRS - could get ugly with multi-part + holes.
  • See if sf objects can be converted to standard data frame or matrix in a way that can easily be reversed. I think this is the best option

I think using a simplified representation of the sf polygon geom that can be easily converted back into an sf object makes the most sense:

  • metadata$clip Vector representation of clipping polygon - ideally without using any non-standard R classes by converting the sf geometry into a three column data frame with columns: id, x, and y.
  • metadata$clip$percent_lost Record the percent of each week's distribution that was lost during clipping (52 week vector).
  • get_clip() new function retrieves the clip and converts it into a proper sf object with CRS assigned from geom$crs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions