Skip to content

Create a geom_sf() or sf_transform() argument to rotate a map? #2523

Open
@brooke-l-hawkins-noaa

Description

@brooke-l-hawkins-noaa

I'm creating maps of the US West Coast and California, and want an easy way in R to rotate the map to better feature the coastline.

  • I expected to find an easy sf::sf_transform() argument, or ggplot::geom_sf() argument that would take care of it, and didn't.
  • I checked the sf documentation, and I calculated the rotation with rot = function(a) matrix(c(cos(a), sin(a), -sin(a), cos(a)), 2, 2), but that seemed like it would be easy to mess up when plotting multiple layers together that need the same rotation.
  • I ended up asking a colleague for shape files with rotated coordinate reference systems from ArcGIS as a workaround. Which works, but feels a bit clunky still too, since the whole plotting workflow isn't in R.

It's my first time contributing an issue in this project, let me know if you need more details!

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