Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine the Oblique Mercator projection pages into one page #3451

Merged
merged 10 commits into from
Sep 28, 2024
6 changes: 3 additions & 3 deletions doc/techref/projections.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ The table below shows the projection codes for the 31 GMT map projections:
| **L**{{ lon0 }}/{{ lat0 }}/{{ lat1 }}/{{ lat2 }}/*width* | {doc}`/projections/conic/conic_lambert` |
| **M**[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`/projections/cyl/cyl_mercator` |
| **N**[{{ lon0 }}/]*width* | {doc}`/projections/misc/misc_robinson` |
| **Oa**{{ lon0 }}/{{ lat0 }}/*azimuth*/*width*[**+v**] | {doc}`/projections/cyl/cyl_oblique_mercator_1` |
| **Ob**{{ lon0 }}/{{ lat0 }}/{{ lon1 }}/{{ lat1 }}/*width*[**+v**] | {doc}`/projections/cyl/cyl_oblique_mercator_2` |
| **Oc**{{ lon0 }}/{{ lat0 }}/{{ lonp }}/{{ latp }}/*width*[**+v**] | {doc}`/projections/cyl/cyl_oblique_mercator_3` |
| **Oa**{{ lon0 }}/{{ lat0 }}/*azimuth*/*width*[**+v**] | Oblique Mercator projection: {doc}`1. origin and azimuth </projections/cyl/cyl_oblique_mercator>` |
| **Ob**{{ lon0 }}/{{ lat0 }}/{{ lon1 }}/{{ lat1 }}/*width*[**+v**] | Oblique Mercator projection: {doc}`2. two points </projections/cyl/cyl_oblique_mercator>` |
| **Oc**{{ lon0 }}/{{ lat0 }}/{{ lonp }}/{{ latp }}/*width*[**+v**] | Oblique Mercator projection: {doc}`3. origin and projection pole </projections/cyl/cyl_oblique_mercator>` |
seisman marked this conversation as resolved.
Show resolved Hide resolved
yvonnefroehlich marked this conversation as resolved.
Show resolved Hide resolved
| **P***width*[**+a**][**+f**[**e**\|**p**\|*radius*]][**+r***offset*][**+t***origin*][**+z**[**p**\|*radius*]] | Polar {doc}`azimuthal </projections/nongeo/polar>` ({math}`\theta, r`) or cylindrical |
seisman marked this conversation as resolved.
Show resolved Hide resolved
| **Poly**/[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`/projections/conic/polyconic` |
| **Q**[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`/projections/cyl/cyl_equidistant` |
Expand Down
70 changes: 70 additions & 0 deletions examples/projections/cyl/cyl_oblique_mercator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
r"""
Oblique Mercator projection
===========================

Oblique configurations of the cylinder give rise to the oblique Mercator projection.
It is particularly useful when mapping regions of large lateral extent in an oblique
direction. Both parallels and meridians are complex curves. The projection was
developed in the early 1900s by several workers.

The projection is set with **o** or **O**. There are three different specification
ways (**a**\|\ **A**, **b**\|\ **B**, **c**\|\ **C**) available. For all three
definitions, the upper case letter mean the projection pole is set in the southern
hemisphere [Default is northern hemisphere]. Align the y-axis with the optional
modifier **+v**. The figure size is set with *scale* or *width*.
"""

# %%
Copy link
Member

Choose a reason for hiding this comment

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

I feel it's a little weird to show three mini maps in one gallery thumbnail image (https://pygmt-dev--3451.org.readthedocs.build/en/3451/projections/index.html#cylindric-projections). Since it's just three different ways to specify one projection, maybe we can show three separate maps in this example and only show one of them in the gallery summary page?

Copy link
Member Author

@yvonnefroehlich yvonnefroehlich Sep 26, 2024

Choose a reason for hiding this comment

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

I combined the three maps into one figure, because the maps for the options Oa and Ob are quite high. And having all three maps in the current size below each other makes the website quite long. But your are right, the thumbnail image looks not optimal.
In commit cd15b7d I tested showing separate maps for using a much smaler sizes for the maps. For the thumbnail image I picked the map for Oc, as the ascept ratio seems to fit best to the thumbnail image card.

Copy link
Member

Choose a reason for hiding this comment

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

And having all three maps in the current size below each other makes the website quite long.

I prefer to have the figure below each subsection, which is easier to read IMHO. Let's hear what others think about it.

Copy link
Member Author

@yvonnefroehlich yvonnefroehlich Sep 27, 2024

Choose a reason for hiding this comment

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

Ah, I have missed this point from your first review comment here. I just worked on removing the subplot. If having separate code blocks within each subsection, I think it's also OK to show the maps separatly, even though the maps have a larger height. However, having them all tree below each other at the end looked not good.

Togther at the end Separatly within each subsection
omp_at_the_end omp_within_each_subsection

Copy link
Member

Choose a reason for hiding this comment

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

I like the new layout.

# 1. Using the origin and azimuth
# -------------------------------
#
# **oa**\|\ **oA**\ *lon0/lat0/azimuth/scale*\[**+v**] or
# **Oa**\|\ **OA**\ *lon0/lat0/azimuth/width*\[**+v**]
#
# The central meridian is set by *lon0/lat0*. The oblique equator is set by *azimuth*.

import pygmt

fig = pygmt.Figure()
fig.coast(
projection="Oa-120/25/-30/3c+v",
# Set bottom left and top right coordinates of the figure with "+r"
region="-122/35/-107/22+r",
frame="afg",
land="gray",
)
fig.show()


# %%
# 2. Using two points
# -------------------
#
# **ob**\|\ **oB**\ *lon0/lat0/lon1/lat1/scale*\ [**+v**] or
# **Ob**\|\ **OB**\ *lon0/lat0/lon1/lat1/width*\ [**+v**]
#
# The central meridian is set by *lon0/lat0*. The oblique equator is set by *lon1/lat1*.

fig = pygmt.Figure()
fig.coast(
projection="Ob130/35/25/35/3c", region="130/35/145/40+r", frame="afg", land="gray"
)
fig.show()


# %%
# 3. Using the origin and projection pole
# ---------------------------------------
#
# **oc**\|\ **oC**\ *lon0/lat0/lonp/latp/scale*\ [**+v**] or
# **Oc**\|\ **OC**\ *lon0/lat0/lonp/latp/width*\ [**+v**]
#
# The central meridian is set by *lon0/lat0*. The projection pole is set by *lonp/latp*.

fig = pygmt.Figure()
fig.coast(
projection="Oc280/25.5/22/69/4c", region="270/20/305/25+r", frame="afg", land="gray"
)
fig.show()

# sphinx_gallery_thumbnail_number = 3
34 changes: 0 additions & 34 deletions examples/projections/cyl/cyl_oblique_mercator_1.py

This file was deleted.

34 changes: 0 additions & 34 deletions examples/projections/cyl/cyl_oblique_mercator_2.py

This file was deleted.

33 changes: 0 additions & 33 deletions examples/projections/cyl/cyl_oblique_mercator_3.py

This file was deleted.