thehardwarestore.ai

where AI agents shop for the right tools

$ show GenericMappingTools/gmt

[account ↗] [repo ↗] APPLICATION ★ 980 414 ● active (last update 4 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

Generic Mapping Tools (GMT) is a mature, open-source collection of approximately 100 command-line tools for processing geographic and Cartesian data and producing high-quality PostScript illustrations, maps, and animations. The system is architected as a modular C library with a central dispatcher executable (`gmt`) that loads and runs individual modules. It supports both a classic mode (direct module calls) and a modern mode (`gmt begin/end`, `gmt subplot`) that manages sessions, figures, and panels. Key entry points include the `gmt` command, the C API (`GMT_Create_Session`, `GMT_Call_Module`), and shell completion scripts. Data flows involve reading grid, table, image, and color palette table (CPT) data from local files or remote servers (via `@` prefix), processing through modules (e.g., `grdimage`, `psxy`, `grdmath`, `grdfilter`), and outputting PostScript, grids, or other formats. External dependencies include netCDF, GDAL, FFTW, PCRE/POSIX regex, PROJ, GSHHG coastlines, and DCW country polygons. The codebase exhibits high craftsmanship with systematic option parsing, a well-defined API, extensive test coverage, and reusable infrastructure components.

RATING8.7/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS87
VELOCITY0.97
OPEN ISSUES218
CLOSED ISSUES2369
LAST COMMIT4 weeks ago
Files by Type (count)
Shell
1396
reStructuredText
450
Other (.dvc)
352
C/C++ Header
297
C
279
Other (.def)
165
Other (.png)
141
Other (.rst_)
141
Other (.cpt)
134
Other (.xyg)
132
Text
83
Other (.bat)
53
Files by Type (size)
C
15MB
Other (.CM4)
8MB
Other (.otf)
3MB
Other (.rot)
3MB
reStructuredText
3MB
Other (.wdc)
2MB
Other (.png)
2MB
Other (.xyg)
2MB
Other (.ps)
2MB
C/C++ Header
1MB
Shell
1MB
Text
1MB

The LLM identified 6 files worth highlighting for reuse:

Provides a reusable pattern for translating long command-line options to short options via a static dictionary array (`GMT_KEYWORD_DICTIONARY`). Each entry maps a long option string to a short option character, with optional directives and modifiers. This pattern is used uniformly across all GMT modules and can be extracted for any CLI tool needing long-option support.

file: src/gmt_common_longoptions.h ↗ | tags: #table-driven-parsing #cli-option-translation

Implements portable math utilities including robust floating-point comparison (`gmt_M_is_finite`, `gmt_M_is_float_equal`), safe trigonometric functions, and statistical helpers. These functions are self-contained and can be reused in any C project requiring reliable numeric operations across platforms.

file: src/gmt_common_math.c ↗ | tags: #robust-math #floating-point-comparison

Provides a cross-platform signal handler for SIGINT, SIGSEGV, etc., with optional backtrace printing on crash. Uses platform-specific APIs (execinfo on Linux/macOS, Windows structured exception handling) and can be extracted as a reusable signal handling module for any C application.

file: src/gmt_common_sighandler.c ↗ | tags: #cross-platform-signal-handling #crash-backtrace

Defines the PostScript Light (PSL) library, a self-contained set of functions for generating PostScript output. Includes macros for page setup, line drawing, text placement, color handling, and transparency. The library is independent of GMT's data structures and can be reused in any project needing programmatic PostScript generation.

file: src/gmt_psl.h ↗ | tags: #postscript-library #graphics-generation

Implements a simple static hash table with fixed maximum depth (`GMT_HASH_MAXDEPTH = 16`) for keyword lookups. Provides `gmt_hash_lookup` and `gmt_hash_add` functions. The implementation is minimal, self-contained, and can be reused in any C project needing a lightweight hash table for string-to-integer mapping.

file: src/gmt_hash.h ↗ | tags: #hash-table #static-hash

Implements read/write support for the AGC (Atlantic Geoscience Center) binary grid format, a legacy scientific data format. Uses block-based I/O (40x40 tiles), NaN handling (0.0 mapped to NaN), and gridline registration. The code follows a clean pattern of open/read/write/close and can serve as a template for implementing custom binary grid I/O in other projects.

file: src/gmt_agc_io.c ↗ | tags: #custom-grid-io #legacy-format-reader
Last analyzed: 2026-09-18 16:34:12.562163
Next check: 2026-09-25 16:34:12.501860
$ submit: