How to generate psxy lat-lon input text files for US county boundaries

Hello GMT Users:

In the past I’ve used simple text files to plot the boundaries of U.S. Climate Division regions using psxy. These regions typically contain more than one US county. A text file for a typical climate division is just a sequence of lat-lon coordinates for the division’s boundaries, e.g. ,

29.673473   -85.073997
29.633474   -85.097000
29.679474   -85.224998
29.663473   -85.356003
29.687471   -85.375000
  ....       ....     .....   ......
29.715471   -84.994003
29.699471   -85.189003
29.673473   -85.073997

These lat-lon coordinates were made available in text files provided by the National Climate Data Center (now NCEI).

In my current work I’d like to do analysis of county hail event data and plot the results at the county level using GMT. However, my web searches show that county-level boundary data is typically made available in ESRI shape files. I work on a Mac and do not have much experience with ArcGIS.

Does anyone have experience in using GMT to plot US county boundaries? Are there subroutines or packages that extract information from shapefiles to provide simple lat-lon boundary information that can be input to psxy? It would help if these subroutines didn’t require ESRI software, as that would require me to set up my Mac to dual boot into Windows.

If you have a shapefile that you would like to convert to the OGR/GMT-format, install gdal and use:

ogr2ogr -F GMT output.gmt input.shp

I have never tried it, but I think GMT provides state-by-state stuff for the US. See https://docs.generic-mapping-tools.org/dev/pscoast.html Required Arguments -> -R -> Section 4.

Andreas: Thanks very much. I’ll try both those possible solutions.