Using pscoast to extract country boundaries

Dear GMTers,

I am trying to obtain the boundaries of the 48 conterminous US states with the following command

gmt pscoast -E US.AL,US.AZ ... -M -Dh > ./tmp/boundary.txt

When I provide the full list of countries I get the following message:

Abort trap: 6

If I reduce the number of countries, the command works but of course I do not achieve my goal.

Any suggestion on how to resolve this (apart from repeating 48 times the command above)?

Thank you very much in advance for your help and for distributing this wonderful software.


Can you post the full command that lead to the issue?

If you can do it by chunks then you don’t need to repeat 48 times. Just do

gmt pscoast -E first pack > . /tmp/boundary.txt
gmt pscoast -E second pack >> . /tmp/boundary.txt

Interestingly, this works:


While this one does not:


Thank you again Joaquim

I can reproduce the problem. both of your commands crash for me. Note that you should not be using -Dh because DCW has no variable multiple resolutions but it’s the reason of the problem.

Should be fixed by PR #2066
IT was a variable too short. Your command works as long as the total length after -E is not larger than 256

Thanks for catching this.

Thanks a lot Joaquim!