Stamp with several modules
scripts/stamp.sh runs several modules over one input in sequence, so the
result is a single file carrying the new columns of every module you selected.
Each module is chained onto the previous one’s output, its columns accumulating,
and the in-between files are written to a temporary directory that is removed
when the script ends. Only the final output file remains.
scripts/stamp.sh [options] <input> <output>
Selecting modules
A module runs only when you give its data source, so the flags pick both the modules and their inputs. At least one module must be selected.
| Flag | Module | Data source |
|---|---|---|
--coast PATH | coast | GSHHG shapefile dir or GSHHS_*_L1.shp |
--depth FILE | depth | GEBCO bathymetry NetCDF |
--sea PATH | sea | IHO Sea Areas GeoJSON or shapefile |
--countries FILE | place | Natural Earth countries shapefile |
--nearest FILE | nearest | reference table of named locations |
The modules run in a fixed order (coast, depth, sea, place, nearest); the order does not matter, since each adds distinct columns.
Per-module options
| Option | Applies to | Meaning |
|---|---|---|
--municipalities FILE | place | GISCO LAU municipalities (optional) |
--coast-unit km|m | coast | Distance unit (default km) |
--depth-positive | depth | Report depth positive below sea level |
--depth-on-land | depth | Add an on_land boolean column |
--max-municipality-dist N | place | Drop a municipality match further than N away |
--place-unit km|m | place | Unit for municipality_dist and its cutoff (default km) |
--sea-name-field STR | sea | Feature field with the sea name (default NAME) |
--nearest-name-field STR | nearest | Reference name column (default name) |
--nearest-unit km|m | nearest | Distance unit (default km) |
Common and other options
--region, --partition, --lon-col, --lat-col, --decimals, and
--threads are passed to every module that accepts them (--region and
--partition only to coast, sea, and place). --threads reaches depth too,
but not its grid lookup, which always runs on one thread. --in-format
describes the original input. Other options:
| Option | Meaning |
|---|---|
--bin PATH | seastamp binary (default: $SEASTAMP_BIN, else the one on PATH, else ./target/release or ./target/debug) |
-k, --keep | Keep the intermediate files (default: remove them) |
-n, --dry-run | Print the commands without running them |
--partition and --region are exclusive, here as in seastamp itself: a
partitioned run derives a box and a projection center for each piece of the
input, so there is no single region to set. Passing both is an error before any
module runs.
Each step chains onto the previous one’s output, which carries the same points, so every partitioned module in a chain splits the input the same way and reports the same partition count. See auto or partition for when the flag is worth using.
Example
scripts/stamp.sh cores.parquet cores.stamped.parquet \
--coast ./data/gshhg/gshhg-shp-2.3.7/GSHHS_shp/f \
--depth ./data/gebco/GEBCO_2024_sub_ice_topo.nc \
--nearest farms.parquet --nearest-name-field farm_name
This writes one file, cores.stamped.parquet, with the original columns plus
dist_to_coast, bathymetry, nearest_name, and nearest_dist. The
intermediate coast-only and coast+depth files are removed on exit.
The intermediate files are Parquet (lossless); the final file’s format follows
its extension, so cores.stamped.csv.gz would be written as gzipped CSV.