Skip to content
lubyantPublic

About

Digital Shoreline Analysis System (DSAS)

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

69 Commits

Folders and files

Repository files navigation

codecov

OpenDSAS (Digital Shoreline Analysis System)

OpenDSAS is a high-performance, cross-platform reimplementation of the USGS
Digital Shoreline Analysis System (DSAS).
It is designed for fast, memory-efficient shoreline change analysis in command-line workflows.

Compared to the official USGS DSAS:

  • πŸš€ Up to 100Γ— faster execution
  • πŸ’Ύ Uses only ~5% of the memory
  • πŸ–₯️ Optimized for Linux + CLI/HPC environments

πŸ” Why OpenDSAS?

OpenDSAS is ideal if:

  • Your shoreline analysis is large-scale, time-consuming, or memory-intensive
  • You prefer command-line workflows and Linux HPC environments
  • You need parallelized computation on large datasets

πŸ“¦ Installation

pip (Linux, macOS arm64, Windows)

pip install opendsas

This installs the same static dsas binary published in Releases, wrapped in a platform wheel β€” no compiler or build step required.

Linux

Download the pre-built static binary β€” this URL always points to the latest release:

curl -LO https://github.com/lubyant/OpenDSAS/releases/latest/download/opendsas-linux-x86_64
chmod +x opendsas-linux-x86_64
sudo mv opendsas-linux-x86_64 /usr/local/bin/dsas

For ARM (servers, Raspberry Pi), use opendsas-linux-arm64 instead of opendsas-linux-x86_64.

The binary is fully statically linked β€” it runs on any Linux distribution (Ubuntu, Debian, RHEL, Alpine, etc.) with no dependencies.

macOS

Install via Homebrew using the OpenDSAS tap:

brew tap lubyant/opendsas https://github.com/lubyant/OpenDSAS
brew install lubyant/opendsas/opendsas

Requires Apple Silicon (M1/M2/M3). An Intel build is not provided.

Windows

Download opendsas-vX.Y-windows-x86_64.exe from Releases, rename it to dsas.exe, and add it to your PATH.


Build from Source

Prerequisites

  • CMake β‰₯ 3.14
  • C++20-compatible compiler (GCC 11+, Clang 14+, MSVC 2022+)
  • macOS only: brew install libomp

All other dependencies (nlohmann/json, shapelib, argparse) are fetched automatically by CMake.

git clone https://github.com/lubyant/OpenDSAS.git
cd OpenDSAS

cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)

# optional: install to system PATH
sudo cmake --install build

βš™οΈ Usage

Supported Input Formats

Both Shapefile (.shp) and GeoJSON (.geojson / .json) are accepted for all input files.
All input and output files in a single command must use the same format β€” mixing formats (e.g. a .geojson input with a .shp output) is an error.

Quick Example

# Shapefile inputs
dsas --baseline baseline.shp --shoreline shoreline.shp --transect-length 1000 --transect-spacing 10

# GeoJSON inputs
dsas --baseline baseline.geojson --shoreline shoreline.geojson \
     --output-intersect intersects.geojson --output-transect transects.geojson \
     --transect-length 1000 --transect-spacing 10

Command-Line Options

Root Command

Option Description Default
-h, --help Show help message β€”
-v, --version Print version info β€”
--baseline [FILE] Path to baseline file (.shp or .geojson) β€”
--bid-field [STR] Field name for baseline ID in baseline data id
--shoreline [FILE] Path to shoreline file (.shp or .geojson) β€”
--date-field [STR] Field name for date in shoreline data Date
--date-format [STR] Date format in shoreline data %Y/%m/%d
--output-intersect [FILE] Output intersections file (must match input format) intersects.shp
--output-transect [FILE] Output transects file (must match input format) transects.shp
--smooth-factor [N] Smoothing factor 1
--transect-length [N] Transect length 500
--transect-spacing [N] Spacing between transects 30
--intersection-mode [MODE] Intersection rule: closest or farthest closest
--transect-orientation [MODE] Transect orientation: left, right, or mix (half left, half right) mix
-bi, --build_index Build spatial index (faster queries, slower initial build) false

Cast Command

Generate transects from a baseline.

Click to expand cast options
Option Description Default
-h, --help Show help message β€”
-v, --version Print version info β€”
--baseline [FILE] Path to baseline file (.shp or .geojson) (required) β€”
--bid-field [STR] Field name for baseline ID in baseline data id
--output-transect [FILE] Output transects file (must match input format) transects.shp
--smooth-factor [N] Smoothing factor 1
--transect-length [N] Transect length 500
--transect-spacing [N] Spacing between transects 30
--intersection-mode [MODE] Intersection rule: closest or farthest closest
--transect-orientation [MODE] Transect orientation: left, right, or mix mix

Cal Command

Generate intersections and calculate erosion rates using predefined transects.

Click to expand cal options
Option Description Default
-h, --help Show help message β€”
-v, --version Print version info β€”
--transect [FILE] Path to transect file (.shp or .geojson) (required) β€”
--shoreline [FILE] Path to shoreline file (.shp or .geojson) (required) β€”
--date-field [STR] Field name for date in shoreline data Date
--date-format [STR] Date format in shoreline data %Y/%m/%d
--output-intersect [FILE] Output intersections file (must match input format) intersects.shp
--intersection-mode [MODE] Intersection rule: closest or farthest closest
--transect-orientation [MODE] Transect orientation: left, right, or mix mix
-bi, --build_index Build spatial index (faster queries, slower initial build) false

πŸ—‚ Preparing Input Data

Input files may be Shapefile (.shp) or GeoJSON (.geojson / .json).
All files in one command invocation must use the same format.

Shoreline File

Must contain a Date field (or the name given by --date-field):

Date
YYYY/MM/DD
  • Example: 2000/01/01
  • A shoreline ID field is auto-generated (custom IDs not yet supported)

Baseline File

Must contain an Id field (or the name given by --bid-field):

Id
baseline id

πŸ“€ Output

OpenDSAS generates two output files (Shapefile by default; format matches your inputs):

1. intersects.shp

BaselineId TransectId ShoreID Date ref_dist X Y
baseline id transect id shoreline id intersection date distance to baseline x y

2. transects.shp

TransectId BaselineId ChangeRate
transect id baseline id shoreline change rate

πŸ›  Roadmap

  • GUI frontend

πŸ“š Citing OpenDSAS

If you use OpenDSAS in your research, please cite it as:

@misc{OpenDSAS,
  author       = {Lu, Boyuan; Wang, wei},
  title        = {OpenDSAS: A High-Performance Digital Shoreline Analysis System},
  year         = {2025},
  publisher    = {GitHub},
  journal      = {GitHub repository},
  howpublished = {\url{https://github.com/lubyant/OpenDSAS}},
}

πŸ“œ License

MIT License

About

Digital Shoreline Analysis System (DSAS)

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages