Closed ryoliver closed 1 month ago
Sub-tasks for "update assignment with Easter Island example":
marmap
API to download bathymetry data around Easter Island, see if it looks good and is easy enough for students to work with, consider its CRS and resolutionThis data can be imported using the marmap
API easily without a key. After some exploration of the different marmap
functions, the NOAA data is easiest to work with sf
in raster format. Therefore I suggest that it is downloaded as a raster, then if we also want to provide the same data to the students in vector format, the raster should be converted to a dataframe using terra::as.data.frame
resolution
parameter in the documentation), we could ask the students to investigate or explainmeters
in the legend units as an assumptionmarmap
API and these maps to the shared data dir in the drive so other can change/replace data files in the future as well (and I can convert the qmd to an R script if that's preferred)Another consideration for mapping the bathymetry data:
The way I mapped both the raster and vector bathymetry data with tmap
, including the parameter midpoint = NA
within tm_dots()
is important for visualizing all the values of the blue palette, because this overrides the default for this parameter, which is 0 when negative and positive values are present in the data. Setting this to NA instead allows for the full range of my palette to be visualized. If this parameter is not included, the bathymetry data may look like just 1- 2 colors. I can see how students may overlook this if they 1) do not have an idea of what the bathymetry data "should" look like with a full spectrum, or 2) they are unfamiliar with this parameter from lecture or reading.
This is great!! I'll start working on writing HW1. Could you send the code that you used to produce these maps so I can figure out which/how many hints to include?
I converted my qmd
for the API and plotting to an R script and uploaded it to the shared data folder in a new subdir week1/bathymetry. The R script saves the raster and vector bathymetry files as a tif
and gpkg
, and outputs the plots to a single PDF. I uploaded these 3 files to the subdir as well so you don't have to run the script unless you want to re-do the data download or plots.
If we want to make any of the suggested changes to the files, like change the CRS or extent, I can take care of it!
Here's the R script here for convenience as well:
In pursuit of another vector dataset option for HW1, I downloaded this seamount dataset and subset the points in R to the same bounding box used to subset the bathymetry data. Here they're visualized with mapview
:
It's only 4 points and arguably not that interesting, but has a few attributes that could be used for the palette (height, depth, etc) and aligns well with the bathymetry dataset.
Just need tmap to zoom a little bit out to gather that 4th point, I think...
thanks so much! this is all great! working on putting together HW1 now.
Great, in case we want to use this data, I'll clean up the code for subsetting it/tranforming etc. and share it.
I added the data to the folder in week1/seamounts. global_seamounts
contains the original shapefile file downloaded from the source with every seamount documented, and ei_seamounts
is just the 4 relevant points for Easter Island.
that's perfect, thanks!
I wonder if it be confusing for students to be introduced to geopackage
format so early in the quarter? It requires no extra steps, it's imported the same as a shapefile, but I don't want to frazzle them.
My code for subsetting the seamount data from the global file to just the Easter Island seamounts, as well as the code to plot all the data layers together using tmap
, is now in an R script in the data dir here, called ei_sm_tmap.R
I was able to make the plot include all seamount points by creating a new bbox for the tmap
, as shown in the script. The plot is output to a PDF in the same subdir called ei_all_layers.pdf
For convenience, the script is here as well: