Repository navigation
Closed
GenericMappingTools/gmt
#4815Labels
bugSomething isn't workinggood first issueGood for newcomershelp wantedHelping hands are appreciatedupstreamBug or missing feature of upstream core GMT
Milestone
Description
Description of the problem
Using fig.coast(dcw=...) fails, asking for additional kwargs. I have to add another kwarg, like water='white', to get things to plot. I believe that dcw alone should be enough.
Full code that generated the error
import pygmt
fig = pygmt.Figure()
fig.coast(region='US', projection='S232.7435/90/8i', frame=['af', 'EWSn'], dcw='US+gred')
fig.show()Expected output
Full error message
---------------------------------------------------------------------------
GMTInvalidInput Traceback (most recent call last)
<ipython-input-10-bd3570a700d7> in <module>
2
3 fig = pygmt.Figure()
----> 4 fig.coast(region='US', projection='S232.7435/90/8i', frame=['af', 'EWSn'], dcw='US+gred')
5 fig.show()
/opt/miniconda3/envs/roses/lib/python3.7/site-packages/pygmt/helpers/decorators.py in new_module(*args, **kwargs)
279 if alias in kwargs:
280 kwargs[arg] = kwargs.pop(alias)
--> 281 return module_func(*args, **kwargs)
282
283 new_module.aliases = aliases
/opt/miniconda3/envs/roses/lib/python3.7/site-packages/pygmt/helpers/decorators.py in new_module(*args, **kwargs)
423 kwargs[arg] = separators[fmt].join(f"{item}" for item in value)
424 # Execute the original function and return its output
--> 425 return module_func(*args, **kwargs)
426
427 return new_module
/opt/miniconda3/envs/roses/lib/python3.7/site-packages/pygmt/src/coast.py in coast(self, **kwargs)
191 raise GMTInvalidInput(
192 """At least one of the following arguments must be specified:
--> 193 lakes, land, water, rivers, borders, Q, or shorelines"""
194 )
195 with Session() as lib:
GMTInvalidInput: At least one of the following arguments must be specified:
lakes, land, water, rivers, borders, Q, or shorelines
System information
Please paste the output of python -c "import pygmt; pygmt.show_versions()":
PyGMT information:
version: v0.0.0
System information:
python: 3.7.9 | packaged by conda-forge | (default, Feb 13 2021, 19:53:10) [Clang 11.0.1 ]
executable: /opt/miniconda3/envs/roses/bin/python
machine: Darwin-20.3.0-x86_64-i386-64bit
Dependency information:
numpy: 1.16.2
pandas: 1.1.5
xarray: 0.15.0
netCDF4: 1.5.3
packaging: 20.9
ghostscript: 9.53.3
gmt: 6.1.1
GMT library information:
binary dir: /opt/miniconda3/envs/roses/bin
cores: 8
grid layout: rows
library path: /opt/miniconda3/envs/roses/lib/libgmt.dylib
padding: 2
plugin dir: /opt/miniconda3/envs/roses/lib/gmt/plugins
share dir: /opt/miniconda3/envs/roses/share/gmt
version: 6.1.1
Metadata
Metadata
Assignees
Labels
bugSomething isn't workinggood first issueGood for newcomershelp wantedHelping hands are appreciatedupstreamBug or missing feature of upstream core GMT

Activity
willschlitzer commentedon Feb 15, 2021
Will GMT coast just accept the E argument with no other land/water colors set? The GMTInvalidError input was likely put in to prevent an error coming back from the GMT API.
seisman commentedon Feb 15, 2021
gmt coast -EUS+gred -pdf mapworks, so confirm it as a bug.willschlitzer commentedon Feb 15, 2021
Sounds good. Looks like we need to just do a quick update to the error raising.
Less than 12 hours since v0.3.0 released and we're already coming up for changes in v0.3.1! 😂
seisman commentedon Feb 15, 2021
Running
gmt coastwithout extra options gives the following error messages:It doesn't mention -E, so also a tiny upstream bug.
seisman commentedon Feb 16, 2021
Reopen the issue because this is also an upstream bug (if I understand it correctly).
The fix is similar and easy. Just need to update these lines in GMT's
pscoast.c: https://github.com/GenericMappingTools/gmt/blob/19db042fc2f1bf09136029bd801ea73f0b6dd30d/src/pscoast.c#L606-L609@willschlitzer Do you want to try it?
willschlitzer commentedon Feb 16, 2021
@seisman Just submitted the PR
joa-quim commentedon Feb 16, 2021
Curious. I went see what I do in Julia and your command jut works (gives the map you show). But probably because under the hood I always add a -Da if option -D is not used. Though this option has no effect with DCW countries