Skip to content

Commit 780f164

Browse files
Combine the Oblique Mercator projection pages into one page (#3451)
1 parent ac10158 commit 780f164

File tree

5 files changed

+73
-104
lines changed

5 files changed

+73
-104
lines changed

doc/techref/projections.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ The table below shows the projection codes for the 31 GMT map projections:
3333
| **L**{{ lon0 }}/{{ lat0 }}/{{ lat1 }}/{{ lat2 }}/*width* | {doc}`/projections/conic/conic_lambert` |
3434
| **M**[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`/projections/cyl/cyl_mercator` |
3535
| **N**[{{ lon0 }}/]*width* | {doc}`/projections/misc/misc_robinson` |
36-
| **Oa**{{ lon0 }}/{{ lat0 }}/*azimuth*/*width*[**+v**] | {doc}`/projections/cyl/cyl_oblique_mercator_1` |
37-
| **Ob**{{ lon0 }}/{{ lat0 }}/{{ lon1 }}/{{ lat1 }}/*width*[**+v**] | {doc}`/projections/cyl/cyl_oblique_mercator_2` |
38-
| **Oc**{{ lon0 }}/{{ lat0 }}/{{ lonp }}/{{ latp }}/*width*[**+v**] | {doc}`/projections/cyl/cyl_oblique_mercator_3` |
36+
| **Oa**{{ lon0 }}/{{ lat0 }}/*azimuth*/*width*[**+v**] | Oblique Mercator projection: {doc}`1. origin and azimuth </projections/cyl/cyl_oblique_mercator>` |
37+
| **Ob**{{ lon0 }}/{{ lat0 }}/{{ lon1 }}/{{ lat1 }}/*width*[**+v**] | Oblique Mercator projection: {doc}`2. two points </projections/cyl/cyl_oblique_mercator>` |
38+
| **Oc**{{ lon0 }}/{{ lat0 }}/{{ lonp }}/{{ latp }}/*width*[**+v**] | Oblique Mercator projection: {doc}`3. origin and projection pole </projections/cyl/cyl_oblique_mercator>` |
3939
| **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 |
4040
| **Poly**/[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`/projections/conic/polyconic` |
4141
| **Q**[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`/projections/cyl/cyl_equidistant` |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
r"""
2+
Oblique Mercator projection
3+
===========================
4+
5+
Oblique configurations of the cylinder give rise to the oblique Mercator projection.
6+
It is particularly useful when mapping regions of large lateral extent in an oblique
7+
direction. Both parallels and meridians are complex curves. The projection was
8+
developed in the early 1900s by several workers.
9+
10+
The projection is set with **o** or **O**. There are three different specification
11+
ways (**a**\|\ **A**, **b**\|\ **B**, **c**\|\ **C**) available. For all three
12+
definitions, the upper case letter mean the projection pole is set in the southern
13+
hemisphere [Default is northern hemisphere]. Align the y-axis with the optional
14+
modifier **+v**. The figure size is set with *scale* or *width*.
15+
"""
16+
17+
# %%
18+
# 1. Using the origin and azimuth
19+
# -------------------------------
20+
#
21+
# **oa**\|\ **oA**\ *lon0/lat0/azimuth/scale*\[**+v**] or
22+
# **Oa**\|\ **OA**\ *lon0/lat0/azimuth/width*\[**+v**]
23+
#
24+
# The central meridian is set by *lon0/lat0*. The oblique equator is set by *azimuth*.
25+
26+
import pygmt
27+
28+
fig = pygmt.Figure()
29+
fig.coast(
30+
projection="Oa-120/25/-30/3c+v",
31+
# Set bottom left and top right coordinates of the figure with "+r"
32+
region="-122/35/-107/22+r",
33+
frame="afg",
34+
land="gray",
35+
)
36+
fig.show()
37+
38+
39+
# %%
40+
# 2. Using two points
41+
# -------------------
42+
#
43+
# **ob**\|\ **oB**\ *lon0/lat0/lon1/lat1/scale*\ [**+v**] or
44+
# **Ob**\|\ **OB**\ *lon0/lat0/lon1/lat1/width*\ [**+v**]
45+
#
46+
# The central meridian is set by *lon0/lat0*. The oblique equator is set by *lon1/lat1*.
47+
48+
fig = pygmt.Figure()
49+
fig.coast(
50+
projection="Ob130/35/25/35/3c", region="130/35/145/40+r", frame="afg", land="gray"
51+
)
52+
fig.show()
53+
54+
55+
# %%
56+
# 3. Using the origin and projection pole
57+
# ---------------------------------------
58+
#
59+
# **oc**\|\ **oC**\ *lon0/lat0/lonp/latp/scale*\ [**+v**] or
60+
# **Oc**\|\ **OC**\ *lon0/lat0/lonp/latp/width*\ [**+v**]
61+
#
62+
# The central meridian is set by *lon0/lat0*. The projection pole is set by *lonp/latp*.
63+
64+
fig = pygmt.Figure()
65+
fig.coast(
66+
projection="Oc280/25.5/22/69/4c", region="270/20/305/25+r", frame="afg", land="gray"
67+
)
68+
fig.show()
69+
70+
# sphinx_gallery_thumbnail_number = 3

examples/projections/cyl/cyl_oblique_mercator_1.py

-34
This file was deleted.

examples/projections/cyl/cyl_oblique_mercator_2.py

-34
This file was deleted.

examples/projections/cyl/cyl_oblique_mercator_3.py

-33
This file was deleted.

0 commit comments

Comments
 (0)