|
| 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 |
0 commit comments