Skip to content

Try a couple more ways to streamline map rotation in R #48

@brooke-l-hawkins-noaa

Description

@brooke-l-hawkins-noaa

I'm making a new issue, since I didn't get to this as part of the spatial_data reorganization ticket #45.

This ticket is about rotating maps, and getting a nice mapping workflow as part of the VMS pipeline. I worked on this some and got a workaround, but I'd like something more streamlined.

Here are my thoughts for outputs:

  • Create a notebook (Rmd or Qmd) with a couple methods explored for rotating maps
    • Is there a way to use rot = function(a) matrix(c(cos(a), sin(a), -sin(a), cos(a)), 2, 2) from the sf documentation that doesn’t remove geometry from the sf object, so the map can still be made with ggplot? Or is there some other workaround?
    • Is there a way to programmatically adjust the CRS using WKT (example file), rather than needing to load an adjusted shapefile for every degree of rotation (example file)?
  • Optionally follow up on sf issue that Brooke started and never replied to…
    • Having supporting code and a non-confidential example would help the discussion.
    • Edzer responded by suggesting I use st_transform() and the new projection, and that’s what I’m already doing, but I think it shouldn’t be necessary. What I actually want is to be able to rotate the output map without needing to upload a new CRS, just by adding a rotation argument in sf_transform or geom_sf. (Is that ignorant spatially of me? I understand that a rotation is technically a projection, but it also seems a bit silly to not be able to just rotate some pixels…)

This is low priority. If we use something interactive like leaflet in an R Shiny app for an interactive visualization tool, then the rotation is less important. This would be relevant for static figures in slides or a paper, though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions