Skip to content

Proposal: Warning when using density2d + coord_mapΒ #2702

@mwaldstein

Description

@mwaldstein

Problem

stat_density_2d does not account for non-euclidean coordinates, such as when using Latitude / Longitude. As a result, when densities are incorrect for densities near the poles and 180 Longitude.

note This may apply for any non-cartesian coordinates (e.g. polar), but I have not tested it.

Options

  • Swap in a spherical density function (e.g. from the Density package) when using map coordinates. This feels like a big lift
  • Block use of density with map coordinates (similar to geom_raster) - There are enough cases (e.g. city-level data sets) where the grid approximation is OK that leaving the option available seems appropriate. A counter argument is that if you're using coord_map, you care about projection where densities will be off. The current behavior has been in place for long enough I'd worry about breaking workflows.
  • Include a warning - My proposed option, to make sure people are aware they are using an approximation likely to cause issues at larger scales.

I'm happy to do the work to implement the warning, but wanted confirmation before creating the pull request.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions