shorelines-converter v3.2.3¶
Mercurial revision 5803:7164e00e8f3d | 2026-08-18
Description¶
shorelines-converter is a tool designed to convert between different coastline formats. It supports a wide range of input and output formats, allowing users to transform coastline data into the desired format for their applications.
Usage¶
shorelines-converter [OPTIONS]
Options¶
Option |
Description |
|---|---|
|
Display this help message and exit. |
|
Path to the input file. |
|
Path to the output file. If not specified, the output filename is derived from the input filename and the output format. |
|
Input format (e.g., |
|
Output format (e.g., |
|
Decimation factor (default: |
|
Minimum length (default: |
|
Projection parameters (e.g., |
|
Root name for output files (used in specific cases like SWOT processing). |
|
Frame string to define a spatial subset (e.g., |
|
Grid file for additional spatial reference. |
|
SWOT-specific processing (e.g., for demangling SWOT ground tracks). |
|
Depth value to assign to the coastline data (for XYZ output). |
File Formats¶
The following coastline formats are supported:
ID |
Format |
|---|---|
0 |
BIN |
2 |
SCAN |
3 |
GSHHS |
6 |
XISO |
7 |
BOUNDARIES |
8 |
SHP |
9 |
NETCDF |
10 |
XY |
11 |
MAPINFO |
12 |
HISTOLITT |
13 |
KML |
15 |
POCFORMULA |
16 |
NEI |
18 |
BEL |
Examples¶
Basic Conversion¶
Convert a coastline file from SCAN to SHP format:
shorelines-converter -i input.scan -oF SHP -o output.shp
Convert with Decimation¶
Reduce the number of points in the coastline data by a factor of 10:
shorelines-converter -i input.scan -o output.scan -d 10
Convert with Minimum Length Filter¶
Remove line segments shorter than 1000 meters:
shorelines-converter -i input.scan -o output.scan -l 1000
Convert with Projection¶
Apply a projection (e.g., +proj=longlat +datum=WGS84) to the coastline data:
shorelines-converter -i input.scan -o output.shp --proj="+proj=longlat +datum=WGS84"
Convert to XYZ Format with Depth¶
Convert coastline data to XYZ format with a depth of -2.0:
shorelines-converter -i input.scan -o output.xyz --depth -2.0
Convert with Spatial Subset¶
Convert a coastline file and limit the output to a specific frame (e.g., xmin:xmax:ymin:ymax):
shorelines-converter -i input.scan -o output.shp --frame "-10:10:-20:20"
SWOT-Specific Processing¶
Process SWOT ground tracks and save in SHP format:
shorelines-converter -i swot_tracks.scan -oF SHP --swot-cut "options" -r swot_output
Convert with Explicit Input and Output Formats¶
Specify both input and output formats explicitly:
shorelines-converter -i input.bin -iF BIN -o output.shp -oF SHP
Environment Variables¶
shorelines-converter uses OpenMP for parallel processing. The following environment variables can be used to control parallelization:
Variable |
Description |
|---|---|
|
Number of threads to use for parallel processing. |
|
Runtime schedule type and chunk size. |
|
Enable/disable dynamic thread adjustment. |
|
Enable/disable nested parallelism. |
Example:
OMP_NUM_THREADS=4 shorelines-converter -i input.scan -o output.shp
Notes¶
Input/Output Formats:
If the input or output format is not specified, the tool attempts to infer it from the file extension.
Use
-iFand-oFto explicitly define the formats if the extensions are non-standard or ambiguous.
Decimation:
The
-doption reduces the number of points in the coastline data by the specified factor.The
-loption removes line segments shorter than the specified length (in meters).
Projection:
The
--projoption allows you to specify projection parameters in PROJ.4 format.If no projection is specified, the data is treated as unprojected (latitude/longitude).
SWOT Processing:
The
--swot-cutoption is designed for processing SWOT mission data (e.g., ground tracks).Use the
-roption to specify a root name for output files in SWOT processing.
Depth Assignment:
The
--depthoption assigns a constant depth value to all points in the coastline data (useful for XYZ output).
Frame Selection:
The
--frameoption allows you to define a spatial subset of the data (e.g.,xmin:xmax:ymin:ymax).