Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pan-Arctic maps for all CMIP6-based items #181

Merged
merged 10 commits into from
Jan 14, 2025

Conversation

cstephen
Copy link
Contributor

@cstephen cstephen commented Dec 5, 2024

This PR is the finished implementation of pan-Arctic (EPSG:3572) maps for all CMIP6-based items, including:

  • CMIP6 monthly data x-ray items
  • CMIP6 indicators data x-ray items
  • The "Arctic Climate Data Node" data story that has an embedded CMIP6 map

Some notes about how this all shook out:

  • After much experimentation, I was not able to get GeoServer to display place names as WMS tiles in the EPSG:3572 projection without it truncating place names along tile boundaries. This was the motivation for loading place names as GeoJSON features on top of the data layer instead, and the results seem good!
  • Lots of thought was put into what communities to show on these maps at zoom level 0. It gets crowded fast, and markers/labels that spill outside of the data circle also look bad IMO. So, I went with the very simple approach of hand-picking State/Province/Country capital cities that fit neatly in the data circle, and omitting some cities where the labels got crowded. These communities and coordinates are hand-coded for now to avoid GeoServer CORS issues (capture in Figure out gs.earthmaps.io CORS issues while trying to fetch community location geometry over WFS #184).
  • The USGSTopo layer that had automagically worked in the EPSG:3572 projection has, just as suddenly, automagically stopped working. After some discussion before the holiday break, we had decided that this layer was no longer necessary because it barely shows up at zoom level 0 anyway, so I've stripped out this code.
  • Because we're no longer showing the USGSTopo layer below the data layer, and communities are displayed as a GeoSJON features on top of the data layer, I've reverted the data layer back to 100% opacity to make it easier to get the map color legends correct. However, I've kept the more muted colors that were produced by the 70%-opacity-over-a-white-background because the muted colors fight less with the coastline and place labels, but are still extremely legible and (in my experience) very color-blind friendly.
  • Setting maxBounds and limits on map panning turned out to be unexpectedly weird and difficult. The strange maxBounds used by the EPSG:3572 maps (BBOX: -15, 20, 165, 20) were discovered by interacting with the maps until I got what I wanted, then interrogating Leaflet to find out what it thought the BBOX was. Panning too far outside of the map extent produces piles of (seemingly harmless) JavaScript errors in the console, so I've increased the maxBoundsViscosity to make it difficult to pan this far outside the map accidentally. Even stranger, this fixes the JavaScript errors vertically but only mitigates them horizontally, but I think this is the best we can do. I've added lots of code comments to explain this madness.
  • The coastline WMS layer technically spills outside of the data layer, but I've added a circular white layer mask over top of it to hide the jank. It seems to load fast enough and works well IMO.
  • The empty circle of data + "ray of hope" near the north pole completely disappeared once I started loading these maps from Zeus! This is awesome and also means we don't need to do the extra work of explaining it.

To test, run the app like this:

nvm use lts/hydrogen
export SNAP_API_URL=https://development.earthmaps.io
export RASDAMAN_URL=https://zeus.snap.uaf.edu/rasdaman/ows
export GEOSERVER_URL=https://gs.earthmaps.io/geoserver/wms
npm run dev

Then, explore some or all of these ARDAC items:

http://localhost:3000/item/temperature-cmip6
http://localhost:3000/item/wind-cmip6
http://localhost:3000/item/oceanography-cmip6
http://localhost:3000/item/precipitation-cmip6
http://localhost:3000/item/evaporation-cmip6
http://localhost:3000/item/solar-radiation-cloud-cover-cmip6
http://localhost:3000/item/indicator-ftc-cmip6
http://localhost:3000/item/indicator-su-cmip6
http://localhost:3000/item/indicator-dw-cmip6
http://localhost:3000/item/indicator-rx1day-cmip6
http://localhost:3000/item/story-arctic-climate-data-node

And also make sure the non-CMIP6-maps continue to work as expected.

@cstephen cstephen marked this pull request as draft December 5, 2024 01:52
@cstephen cstephen marked this pull request as ready for review January 10, 2025 20:32
@brucecrevensten brucecrevensten merged commit dc84198 into main Jan 14, 2025
@brucecrevensten brucecrevensten deleted the cmip6_panarctic_maps branch January 14, 2025 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants