From 6f08755534fd26519d5a7099069f4a55551ade8c Mon Sep 17 00:00:00 2001 From: Felix Palmer Date: Fri, 17 Apr 2026 11:32:59 +0200 Subject: [PATCH] Feature: IVEA projection --- src/pj_list.h | 1 + src/projections/polyhedral.cpp | 15 +++++++++++++++ test/render_nets.sh | 4 ++++ test/unit/test_polyhedral.cpp | 1 + 4 files changed, 21 insertions(+) diff --git a/src/pj_list.h b/src/pj_list.h index 4828e53a3a..888a51e155 100644 --- a/src/pj_list.h +++ b/src/pj_list.h @@ -80,6 +80,7 @@ PROJ_HEAD(imw_p, "International Map of the World Polyconic") PROJ_HEAD(dsea, "Dodecahedral Snyder Equal Area") PROJ_HEAD(isea, "Icosahedral Snyder Equal Area") PROJ_HEAD(isea2, "Icosahedral Snyder Equal Area (generalized)") +PROJ_HEAD(ivea, "Icosahedral Vertex Equal Area") PROJ_HEAD(kav5, "Kavrayskiy V") PROJ_HEAD(kav7, "Kavrayskiy VII") PROJ_HEAD(krovak, "Krovak") diff --git a/src/projections/polyhedral.cpp b/src/projections/polyhedral.cpp index 9d2204a6fa..bab508cb6f 100644 --- a/src/projections/polyhedral.cpp +++ b/src/projections/polyhedral.cpp @@ -131,6 +131,21 @@ PJ *PJ_PROJECTION(isea2) { // TODO rename to `isea`? return P; } +PROJ_HEAD(ivea, "Icosahedral Vertex Equal Area") "\n\tSph"; +constexpr double IVEA_AZ_DEG = 36.0; +PJ *PJ_PROJECTION(ivea) { + auto *Q = static_cast(calloc(1, sizeof(pj_polyhedral_data))); + if (nullptr == Q) return pj_default_destructor(P, PROJ_ERR_OTHER /*ENOMEM*/); + P->opaque = Q; + + polyhedral::load_triangles(Q, decakis_dodecahedron::SPH_TRI, nets::dsea::icosahedron::FACE_TRI); + polyhedral::set_orient_from_angles(Q, ISEA_STD_LAT_DEG, ISEA_STD_LON_DEG, IVEA_AZ_DEG); + + P->fwd = polyhedral_fwd; + P->inv = polyhedral_inv; + return P; +} + PROJ_HEAD(tsea, "Tetrahedral Snyder Equal Area") "\n\tSph"; PJ *PJ_PROJECTION(tsea) { auto *Q = static_cast(calloc(1, sizeof(pj_polyhedral_data))); diff --git a/test/render_nets.sh b/test/render_nets.sh index 18fcc85213..881d585cf0 100755 --- a/test/render_nets.sh +++ b/test/render_nets.sh @@ -31,6 +31,10 @@ $RENDER --proj="+proj=isea2 +R=1" \ --title="ISEA: Icosahedral Snyder Equal Area" \ -o isea_net.png +$RENDER --proj="+proj=ivea +R=1" \ + --title="IVEA: DSEA unfolded onto icosahedral net" \ + -o ivea_net.png + $RENDER --proj="+proj=tsea +R=1" \ --title="TSEA: Tetrahedral Snyder Equal Area" \ -o tsea_net.png diff --git a/test/unit/test_polyhedral.cpp b/test/unit/test_polyhedral.cpp index 3b15aeff67..38456197d1 100644 --- a/test/unit/test_polyhedral.cpp +++ b/test/unit/test_polyhedral.cpp @@ -43,6 +43,7 @@ static const char *proj_strings[] = { "+proj=dsea +net=two_flower +R=1", "+proj=dsea +net=icosahedron +R=1", "+proj=isea2 +R=1", + "+proj=ivea +R=1", }; static void roundtrip_test(const char *proj_string, double tolerance) {