A docker image and fork of @nazmussazib's Rapid Watershed Delineation project, for use in Model My Watershed.
docker run --rm -ti ghcr.io/wikiwatershed/rwd
- Define environment variables (see below)
- Run
./scripts/update.sh
- Run
./scripts/server.sh
- Run
curl http://localhost:5000/rwd/39.892986/-75.276639
- Find the IP of the default VM using
docker-machine ip default
- Run
curl http://<default_vm_ip>:5000/rwd/39.892986/-75.276639
Name | Description | Example |
---|---|---|
RWD_DATA |
Path to RWD data | /media/passport/rwd-nhd |
Folder structure:
> tree -L 2 /media/passport/rwd-nhd/
|-- drb
| |-- Main_Watershed
| `-- Subwatershed_ALL
`-- nhd
|-- Main_Watershed
|-- Subwatershed_ALL
To run RWD inside the MMW application during development, follow these instructions.
In the MMW project:
# Change the rwd_host setting to 10.0.2.2
vim deployment/ansible/roles/model-my-watershed.rwd/defaults/main.yml
vagrant reload worker --provision
Note that 10.0.2.2
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:
./scripts/server.sh
To create a new release, use the following git commands:
$ git flow release start 0.1.0
$ vim CHANGELOG.md
$ vim setup.py
$ git commit -m "0.1.0"
$ git flow release finish -p 0.1.0
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. |