SciTools / cartopy

Cartopy - a cartographic python library with matplotlib support
https://scitools.org.uk/cartopy/docs/latest
BSD 3-Clause "New" or "Revised" License
1.43k stars 366 forks source link

Projection request: Spilhaus projection (world ocean map) #1376

Open AJueling opened 5 years ago

AJueling commented 5 years ago

The Spilhaus projection displays the world ocean as a continuous water mass around Antarctica with the other (highly distorted) continents acting as the map's boundary. I think it would be a great addition to cartopy's functionality especially for oceanographers.

Here is a nice write up of the history of the projection with potential starting points for the implementation: ArcGIS storymap on Spilhaus projection

Spilhaus projection image from https://storymaps.arcgis.com/stories/756bcae18d304a1eac140f19f4d5cb3d (image from aforementioned ArcGIS link)

If I see it correctly, we would need the Adams World Projection in a Square II implemented in PROJ (ref. Adams, O. S. (1929). Conformal Projection of the Sphere Within a Square. Washington: [U.S. Coast and Geodetic Survey Special Publication 153: ftp://ftp.library.noaa.gov/docs.lib/htdocs/rescue/cgs_specpubs/QB275U35no1531929.pdf). Is that correct? Further, can cartopy rotate the resulting projection 45 degrees or does that need to be implemented on the PROJ side?

dopplershift commented 5 years ago

CartoPy relies on PROJ extensively, so all of this is going to largely depend on what's in PROJ.

AJueling commented 5 years ago

Thank you, that's what I thought after looking through the code. If I opened a issue with PROJ, would cartopy need the rotated projection (with the square standing on its side, as shown above) in addition to the original Adams World in a Square II projection (where the square rests on a corner)? Spilhaus is the same projection with different parameters (e.g. the poles are in Asia and South America) and that is subsequently rotated.

Screenshot 2019-10-08 at 12 46 05

(from page 95 of Snyder, J. P. and Voxland, P. M. (1989). An Album of Map Projections. https://doi.org/10.3133/pp1453)

dopplershift commented 5 years ago

Yes, the rotation would need to be handled by PROJ.

AJueling commented 4 years ago

There is an open issue over at PROJ: OSGeo/PROJ#1851

mdaeron commented 6 months ago

Based on this comment there seems to be a Python implementation here. Would this be a suitable starting point to get this projection added to cartopy? (Pale)oceanographers would rejoice :)

dopplershift commented 6 months ago

@mdaeron Currently, all of Cartopy's projections are based on the PROJ library. You are welcome to take on trying to refactor to avoid this, or to make a new pure Python class outside that class hierarchy, but I have no idea how much work is involved.

My advice from above stands: add Spilhaus to the PROJ C library, then Cartopy can easily wrap it.