# "Best" projection for rectangular world map?

**URL:** <https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715>\
**Category:** Q&A\
**Created:** [February 27, 2023, 4:24pm UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715 "2023-02-27T16:24:31Z")\
**Posts on this page:** 13\
**Page:** 5

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [April 25, 2023, 8:30pm UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715/81 "2023-04-25T20:30:31Z")

</div>

Nope. Only what [custom axes](https://docs.generic-mapping-tools.org/latest/cookbook/options.html#custom-axes) allow

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [April 26, 2023, 1:30am UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715/82 "2023-04-26T01:30:56Z")

</div>

To finish this (for now). I can’t make it work on Linux until GDAL fixes the bug (opened an issue). I thought that I could cheat it by running twice saving on disk and reloading but no way. Not even that worked.  
On Win we can now do (function names are not definitive)

```auto
julia> G, cl = worldrectangular("@earth_relief_30m_g", pm=30, latlim=(80,-70), coast=:low);
julia> grid = worldrectgrid(proj="+proj=vandg");
julia> grdimage(G, shade=true, plot=(data=cl,), cmap=:geo, B=:none)
julia> GMT.plotgrid!(G, grid);

```

 ![GMTjl_j-or8](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/9/9185c8945d6c85649fbe63ebfc0cf5c58d11b49d.png)

(@Andreas your [attempts at](https://flint.soest.hawaii.edu/t/project-with-proj-and-plot-with-gmt/3724/3) are perfectly doable with some changes in the functions that do this, and not only coastlines but grids too.)

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [April 26, 2023, 8:36am UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715/83 "2023-04-26T08:36:58Z")

</div>

> [@Joaquim](#):
>
> I can’t make it work on Linux until GDAL fixes the bug (opened an issue).

For reference: the issue @Joaquim opened can be found over at GDAL under [#7644](https://github.com/OSGeo/gdal/issues/7644).

As I unfortunately can’t experiment with your work – is it still possible to extend beyond the +/-180° longitude domain as in [your earlier work above](https://flint.soest.hawaii.edu/t/best-projection-for-rectangular-world-map/3715/51)? To get a chart that spans 400° longitude at the Equator?

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [April 26, 2023, 9:09am UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715/84 "2023-04-26T09:09:48Z")

</div>

That example goes from [-540 540], so it should be a matter of calculating what are the projected coords at +/- 400 and trim the plot at those XX.

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [April 29, 2023, 4:20pm UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715/86 "2023-04-29T16:20:37Z")

</div>

@KristofKoch, you saw Evan’s answer in the GDAL issue. Only way for now is to have on-the-edge GDAL+PROJ build and follow my recipe above to use a local GMT build.

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [May 5, 2023, 11:04pm UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715/87 "2023-05-05T23:04:19Z")

</div>

I have now a minimal working code, though are still many issues that need future work. Namely, the default title offset is not enough to not overlap the custom annotations and those, easily clutter near the prime meridian.

```auto
G, cl = worldrectangular("@earth_relief_30m_p", proj="vandg", latlim=(-70,85), coast=true);
grid = worldrectgrid(G);
grdimage(G, shade=true, plot=(data=cl,), cmap=:geo, B=:none, title="Van der Grinten")
plotgrid!(G, grid, figname="vandg.png", show=true)

```

 ![vandg-or8](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/0/08ac4a6cf1bee79cf52f4cdf2ce492f3bd0e8768.png)

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [May 5, 2023, 11:06pm UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715/88 "2023-05-05T23:06:07Z")

</div>

```auto
G, cl = worldrectangular("@earth_relief_30m_p", proj="aitoff", coast=true, latlim=(-80,89));
grid = worldrectgrid(G, annot_x=[-180,-150,0,150,180]);
grdimage(G, shade=true, plot=(data=cl,), cmap=:geo, B=:none, title="Aitoff")
plotgrid!(G, grid, figname="aitoff.png", show=true)

```

 ![aitoff-or8](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/a/ace9f6a8cb268792d01afe2b7de27574f6bea038.png)

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [May 5, 2023, 11:08pm UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715/89 "2023-05-05T23:08:12Z")

</div>

And there is something strange with Winkel Tripel. It takes much longer to compute and the file is \> 3 times larger

```auto
G, cl = worldrectangular("@earth_relief_30m_p", proj="wintri", coast=true, latlim=(-80,89));
grid = worldrectgrid(G);
grdimage(G, shade=true, plot=(data=cl,), cmap=:geo, B=:none, title="Winkel Tripel")
plotgrid!(G, grid, figname="wintri.jpg", show=true)

```

 ![wintri](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/3/35b04808de2cbd972368babfa61e37f4bb43848e.jpeg)

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [May 18, 2023, 4:41pm UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715/90 "2023-05-18T16:41:28Z")

</div>

That is very impressive @Joaquim - thank you! Now on to installing the bleeding edge GDAL+PROJ versions and then follow your recipe … that day job takes up way too much of my time …

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [June 20, 2024, 10:55am UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715/91 "2024-06-20T10:55:01Z")

</div>

@KristofKoch, how is this project going?

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [August 29, 2024, 3:40pm UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715/92 "2024-08-29T15:40:10Z")

</div>

@Andreas its on the backburner at the moment. Not dead but unfortunately not high priority either.

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [August 29, 2024, 4:13pm UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715/93 "2024-08-29T16:13:48Z")

</div>

Well, the problem is solved in GMT.jl

[https://www.generic-mapping-tools.org/GMTjl\_doc/examples/projections/best\_rectangular/#best\_rectangular\_world\_map\_projection](https://www.generic-mapping-tools.org/GMTjl_doc/examples/projections/best_rectangular/#best_rectangular_world_map_projection)

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [August 29, 2024, 5:24pm UTC](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715/94 "2024-08-29T17:24:54Z")

</div>

@Joaquim you are right - you kindly implemented all the required technology to make it happen. A big thank you for that.

Unfortunately I have not enough time at the moment to make good use of it. I simply need more time and as soon as I produced a proper world map (3-4m wide, your implementation of Leland Browns Texture Shading, OSM Borders & Coastlines, etc) I’ll post it here.

[Previous page](https://forum.generic-mapping-tools.org/t/best-projection-for-rectangular-world-map/3715.md?page=4)
