Skip to content

Commit

Permalink
feature/issue-41 add example query response to docs (#43)
Browse files Browse the repository at this point in the history
* add example query response

* update changelog

---------

Co-authored-by: Frank Greguska <[email protected]>
  • Loading branch information
torimcd and frankinspace authored Dec 4, 2023
1 parent b63e05d commit b5fc98c
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Added
- Issue 41 - Update API documentation with query response examples
- Issue 27 - Create lambda function to execute database loading
- Issue 9 - Create API Usage Documentation
- Issue 4 - User guide for how to run database load script manually
Expand All @@ -16,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Issue 23 - Added github actions with Snyk, pylint, flake8
- Issue 7 - Added actions to build.yml to upload docker container to registry
- Issue 7 - Fixed poetry.lock to account for new vulnerability detected in Synk, given that we are going to remove flask
### Changed
### Changed
- Issue 8 - Hydrocron API implementation with dynamodb local database
- Issue 8 - Rearrange database code
- Issue 8 - Rearrange tests
Expand Down
105 changes: 97 additions & 8 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,103 @@

Search for a single river reach by reach ID.

/timeseries?feature=reach&feature_id=71224300643&output=csv&start_time=2023-08-01T00:00:00&end_time=2023-10-31T00:00:00
/timeseries?feature=Reach&reach_id=73111000545&output=geojson&start_time=2023-06-04T00:00:00&end_time=2023-06-10T00:00:00&fields=feature_id,time_str,wse,geometry

Will return a CSV file, eg:

## Get time series GEOJSON for river node

Search for a single river node by node ID.
Will return geojson, eg:

/timeseries?feature=node&feature_id=45243800160101&output=geojson&start_time=2023-08-01T00:00:00&end_time=2023-10-31T00:00:00
{
"status": "200 OK",
"time": "65.691 ms.",
"type": "FeatureCollection",
"features": [
{
"properties": {
"time": "2023-06-05 06:58:52",
"reach_id": 73111000545,
"wse": -23.9435,
"slope": 0.000005225450000000001
},
"geometry": {
"coordinates": [
[
-67.138008,
45.134336
],
[
-67.140648,
45.137619
],
[
-67.142347,
45.141698
],
[
-67.144123,
45.145777
],
[
-67.144469,
45.146863
],
[
-67.146042,
45.150129
],
[
-67.148479,
45.15503
],
[
-67.149418,
45.156665
],
[
-67.151297,
45.159936
],
[
-67.153499,
45.162672
],
[
-67.158077,
45.162746
],
[
-67.16379,
45.163162
],
[
-67.17678,
45.162777
],
[
-67.18513,
45.164314
],
[
-67.188161,
45.16501
],
[
-67.191202,
45.165436
],
[
-67.194232,
45.166186
],
[
-67.197255,
45.167152
]
],
"type": "LineString"
},
"type": "Feature"
}
],
"hits": 1
}

Will return geojson, eg:
** geometry simplified for example

0 comments on commit b5fc98c

Please sign in to comment.