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 364 forks source link

Add cylindrical equal-area projection (epsg 6933) support #1098

Open mjbrodzik opened 6 years ago

mjbrodzik commented 6 years ago

Description

I am a producer of data using the EASE-Grid 2.0 reference, which includes 3 projections. It looks to me like cartopy supports two of them: Northern and Southern Lambert Equal-Area Azimuthal, but not the third, cylindrical equal-area. Can you add support for this last projection?

Publication with reference coordinate transforms is: http://www.mdpi.com/2220-9964/1/1/32

and some technical corrections that pertain to the cylindrical projection here: http://www.mdpi.com/2220-9964/3/3/1154

The projection I am looking for is defined in EPSG as Projected CRS 6933.

I would be happy to answer any other questions. It would be great to tell users of the EASE-Grid 2.0 data sets that all 3 projections are supported by cartopy.

Thank you for your work on this project.

pelson commented 6 years ago

Hi @mjbrodzik, we have the Lambert Cylindrical projection in cartopy, which probably the cylindrical equal-area projection you are looking for (I didn't double check though). The implementation of the projection can be seen in https://github.com/SciTools/cartopy/blob/v0.16.0/lib/cartopy/crs.py#L1024-L1033. As you can see, this is the "cea" proj4 projection.

I'm very keen to improve cartopy's documentation around projections - in particular, I'm keen to provide simple navigation of the projections based on their developable surface classification (Cylindrical, Conic, Azimuthal, Pseudo-*, etc.) as well as their preserving metric (equidistant, equal-area, conformal, etc.). If you have any thoughts on this, or even a desire to get involved your contributions would be most welcome! 👍

Hope that helps,

mjbrodzik commented 6 years ago

Hi, yes, I saw that but I need to be able to specify a true latitude. The proj4 string for the projection I need to specify includes the +lat_ts option and the WGS84 projection ellipsoid, like this:

+proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m

So it's not clear to me from the link you included https://github.com/SciTools/cartopy/blob/v0.16.0/lib/cartopy/crs.py#L1024-L1033

if that's using a spherical projection ellipsoid? I'm just not familiar enough with the Globe class to evaluate this for myself.

I would be interested in contributing if you want to elaborate more on your vision about improving documentation.

dopplershift commented 6 years ago

Well, I started to write something up, but then I looked again and see that LambertCylindrical has a hard-coded Globe. That’s no good. Looks like a problem similar to #709.

@pelson can you shed any light on why it is implemented this way?

pelson commented 5 years ago

@pelson can you shed any light on why it is implemented this way?

Sorry for taking my time on this one (we've even spoken face to face between you asking that question and now 🤣). There is a really simple answer to why LambertCylindrical is like that - it has been there since day one of cartopy, and that was long before we even had the concept of Globes! Nobody has needed to implement support for anything else it seems. 👍

snowman2 commented 3 years ago

With #1808:

>>> from cartopy.crs import Projection
>>> crs = Projection("EPSG:6933")
>>> crs
<Projected CRS: EPSG:6933>
Name: WGS 84 / NSIDC EASE-Grid 2.0 Global
Axis Info [cartesian]:
- X[east]: Easting (metre)
- Y[north]: Northing (metre)
Area of Use:
- name: World between 86°S and 86°N.
- bounds: (-180.0, -86.0, 180.0, 86.0)
Coordinate Operation:
- name: US NSIDC EASE-Grid 2.0 Global
- method: Lambert Cylindrical Equal Area
Datum: World Geodetic System 1984 ensemble
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich

>>> crs.x_limits
(-17367530.445161372, 17367530.445161372)
>>> crs.y_limits
(-7324184.56362408, 7324184.563624077)

Want to try it out and see if it works?

mjbrodzik commented 3 years ago

Hello, @snowman2 , I'll be happy to test it out. I can't tell from your message which version of cartopy to use. Please advise.

snowman2 commented 3 years ago

Will need to install cartopy from here: https://github.com/snowman2/cartopy/tree/pyprojv2