Skip to content

Issues with N. America coastline and EEZ objects #85

@andrew-edwards

Description

@andrew-edwards

@remi-daigle

I accepted your pull request but had meant to first pull my dev-andy changes into main, and so reverted the pull request. Else I'm getting tangled up!

Also, the plotting didn't quite work. I think some issues are:

  1. coastline_north_america could be simplified, as it includes provinces and states that I don't think we really need. And goes out to Hawaii. plot(coastline_north_america) gives

Image

Though the actual .rda file is not too big, so maybe this isn't such a problem?

  1. north_america_eez.rda is 16 Mb, which is the second biggest object in the package (but has no time component), so I think it would be worth getting it smaller, as it will make the loading of pacea take longer.
    Also, it has a mr_df class; not sure what that is. Looks different to the bc one:
> class(north_america_eez)
[1] "sf"         "mr_df"      "tbl_df"     "tbl"        "data.frame"
> class(bc_eez)
[1] "sf"         "data.frame"
> 

Think we need to have a bit of wrangling like for the BC objects in data-raw/coastline, though I'm no expert on this stuff (I can ask someone to help this week maybe).

And plot(north_america_eez) gives this:

Image

which is probably okay (you wouldn't just plot this), but seems to be missing Alaska coast?

  1. I tried this, which I thought would work, but doesn't quite:
plot.pacea_st(glorys_bottom_temperature,
                      bc = FALSE,
                      eez = FALSE, 
                      north_america = TRUE, 
                      restrict_plot = TRUE)

Image

The restrict_plot should automatically redo (crop) the axes, but I wonder if it's due to the projections being used (and the option is being ignored). Maybe removing Hawaii will help, not sure.

  1. Given the plotting uses ggplot, I wonder if we could just add the north america coast etc. to marea, and just add new options to the end of:
plot.marea_st <- function(x,
                          ...){
  pacea:::plot.pacea_st(x,
                        bc = FALSE,
                        eez = FALSE,
                        ...)
}

So something like:

plot.marea_st <- function(x,
                          ...){
  tplot <- pacea:::plot.pacea_st(x,
                        bc = FALSE,
                        eez = FALSE,
                        ...)
if(north_america == TRUE){
    tplot <- tplot +
      geom_sf(data = coastline_north_america, fill = NA, lty = "dotted")
  }
}

Then also try the restrict_plot option like in plot.pacea_st().

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