Skip to content

ENH: Add HEALPix and rHEALPix projections#2458

Open
greglucas wants to merge 1 commit intoSciTools:mainfrom
greglucas:proj-healpix
Open

ENH: Add HEALPix and rHEALPix projections#2458
greglucas wants to merge 1 commit intoSciTools:mainfrom
greglucas:proj-healpix

Conversation

@greglucas
Copy link
Copy Markdown
Contributor

@greglucas greglucas commented Oct 23, 2024

Rationale

This adds the HEALPix and rHEALPix projections from PROJ to Cartopy.
https://proj.org/en/9.4/operations/projections/healpix.html
https://proj.org/en/9.4/operations/projections/rhealpix.html

This replaces #1008 and allows for flexible globes/radii as well.

closes #882
closes #1008
closes #2133

@greglucas
Copy link
Copy Markdown
Contributor Author

For class names, do we want Healpix() or HEALPix()? Similarly for the rectangular version, do we want Rectangular spelled out, or is RHEALPix as I've put it ok?

@rcomer
Copy link
Copy Markdown
Member

rcomer commented Oct 23, 2024

Also closes #2133 I think.

@lgolston
Copy link
Copy Markdown
Contributor

Always enjoy seeing new projections be added! For the name, I would vote for HEALPix() and rHEALPix().

instance_args = SPECIFIC_PROJECTION_KWARGS.get(prj, {})

prj_inst, instance_repr = create_instance(prj, instance_args)
try:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that I added this here because I don't have PROJ 9.6 installed locally, so this didn't work when instantiated. Maybe there is a better way to approach this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I decided to upgrade my local PROJ and rebuild this file instead. I think it is valuable to keep the Spilhaus image in there. I'm not sure if there is still a better way to do this and allow building this file without all of the projections available...

@greglucas
Copy link
Copy Markdown
Contributor Author

Always enjoy seeing new projections be added! For the name, I would vote for HEALPix() and rHEALPix().

I think I prefer the capitalization of "R" to indicate it is a class in Python by common convention, even if PROJ does lowercase it. Any other votes/preferences on naming?

I think this is ready for review again, and I added in a review comment about the doc build process when someone doesn't have the latest PROJ installed.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Oct 6, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cubic map projection Projection extension - Gnomonic cubed-sphere

5 participants