Skip to content
Rapid Watershed Delineation Code for MMW2
Branch: develop
Clone or download
Pull request Compare This branch is 103 commits ahead of nazmussazib:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A docker image and fork of @nazmussazib's Rapid Watershed Delineation project, for use in Model My Watershed.

Travis CI Docker Repository on Apache V2 License

Getting started

  • Define environment variables (see below)
  • Run ./scripts/
  • Run ./scripts/

Linux & Docker for Mac on macOS

  • Run curl http://localhost:5000/rwd/39.892986/-75.276639

Docker Machine on macOS

  • Find the IP of the default VM using docker-machine ip default
  • Run curl http://<default_vm_ip>:5000/rwd/39.892986/-75.276639

Environment Variables

Name Description Example
RWD_DATA Path to RWD data /media/passport/rwd-nhd

RWD Data

Folder structure:

> tree -L 2 /media/passport/rwd-nhd/
|-- drb
|   |-- Main_Watershed
|   `-- Subwatershed_ALL
`-- nhd
    |-- Main_Watershed
    |-- Subwatershed_ALL

Running inside Model My Watershed

To run RWD inside the MMW application during development, follow these instructions.

In the MMW project:

# Change the rwd_host setting to
vim deployment/ansible/roles/model-my-watershed.rwd/defaults/main.yml
vagrant reload worker --provision

Note that should point to your host. Verify this by running route -n inside the worker VM. It should be the default gateway. For Mac OS X, this IP should be the result of docker-machine ip.

Then in this project, run:



To create a new release, use the following git commands:

$ git flow release start 0.1.0
$ vim
$ vim
$ vim src/api/
$ git add src/api/
$ git commit -m "0.1.0"
$ git flow release publish 0.1.0
$ git flow release finish 0.1.0
$ git push --tags

Afterward, push your develop and master branches to remote using:

$ git push origin develop:develop
$ git push origin master:master



Name Method Description
/rwd/lat/lng GET Run RWD for DRB for client-supplied <lat> & <lng> coordinates.
/rwd-nhd/lat/lng GET Run RWD for NHD for client-supplied <lat> & <lng> coordinates.


Name Type Required/Optional Description
simplify number optional Simplify tolerance for response GeoJSON. Request unsimplified shape with simplify=0. Defaults to 0.0001 for DRB and is derived from the shape's area for NHD when not supplied.
maximum_snap_distance number optional Maximum distance to snap input point. Defaults to 10000 when not supplied.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.