|
1 | 1 | """
|
2 | 2 | coast - Plot land and water.
|
3 | 3 | """
|
| 4 | +from typing import Literal |
4 | 5 |
|
5 | 6 | from pygmt.clib import Session
|
6 | 7 | from pygmt.exceptions import GMTInvalidInput
|
|
37 | 38 | t="transparency",
|
38 | 39 | )
|
39 | 40 | @kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence")
|
40 |
| -def coast(self, **kwargs): |
| 41 | +def coast( |
| 42 | + self, |
| 43 | + resolution: Literal[ |
| 44 | + "auto", "full", "high", "intermediate", "low", "crude" |
| 45 | + ] = "auto", |
| 46 | + **kwargs, |
| 47 | +): |
41 | 48 | r"""
|
42 | 49 | Plot continents, shorelines, rivers, and borders on maps.
|
43 | 50 |
|
@@ -75,11 +82,19 @@ def coast(self, **kwargs):
|
75 | 82 | parameter. Optionally, specify separate fills by appending
|
76 | 83 | **+l** for lakes or **+r** for river-lakes, and passing multiple
|
77 | 84 | strings in a list.
|
78 |
| - resolution : str |
79 |
| - **f**\|\ **h**\|\ **i**\|\ **l**\|\ **c**. |
80 |
| - Select the resolution of the data set to: (**f**\ )ull, |
81 |
| - (**h**\ )igh, (**i**\ )ntermediate, (**l**\ )ow, |
82 |
| - and (**c**\ )rude. |
| 85 | + resolution |
| 86 | + Select the resolution of the GSHHG coastline data set to use. The available |
| 87 | + resolutions from highest to lowest are: |
| 88 | +
|
| 89 | + - ``"full"`` - Full resolution (may be very slow for large regions). |
| 90 | + - ``"high"`` - High resolution (may be slow for large regions). |
| 91 | + - ``"intermediate"`` - Intermediate resolution. |
| 92 | + - ``"low"`` - Low resolution. |
| 93 | + - ``"crude"`` - Crude resolution, for tasks that need crude continent outlines |
| 94 | + only. |
| 95 | +
|
| 96 | + The default is ``"auto"`` to automatically select the best resolution given the |
| 97 | + chosen map scale. |
83 | 98 | land : str
|
84 | 99 | Select filling or clipping of "dry" areas.
|
85 | 100 | rivers : int, str, or list
|
@@ -226,5 +241,7 @@ def coast(self, **kwargs):
|
226 | 241 | """At least one of the following parameters must be specified:
|
227 | 242 | lakes, land, water, rivers, borders, dcw, Q, or shorelines"""
|
228 | 243 | )
|
| 244 | + if kwargs.get("D") is not None: |
| 245 | + kwargs["D"] = kwargs["D"][0] |
229 | 246 | with Session() as lib:
|
230 | 247 | lib.call_module(module="coast", args=build_arg_list(kwargs))
|
0 commit comments