-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/issue 100 Add option to 'compact' GeoJSON result into single feature #177
Conversation
…ch can't be found
… into feature/issue-101
…ature/issue-101
Just an FYI: I created the branch for this PR from the branch for Issue #101 which has not been merged into develop yet so it may cause issues when we merge all open PRs. |
I updated the base for this PR to be feature/issue-101 to reflect the dependency. Once 101 gets merged this PR will automatically get updated to point to develop |
- If the Accept header is `application/json` without an output field, the entire JSON object with metadata including GeoJSON response is returned. | ||
- If the Accept header is none of the accepted types then a 415 Unsupported is returned. | ||
|
||
Example GeoJSON request and response: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your descriptions of the code blocks here is reversed. This is the CSV example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frankinspace - I missed this last week but I think it is fixed now. Do you think the PR is ready to be merged? Merge conflicts should be resolved as well.
@nikki-t can you work on resolving the merge conflicts? |
@frankinspace - Conflicts resolved and merged! I also deployed and tested in SIT to make sure everything looked okay. |
Github Issue: #100
Description
Add option to 'compact' GeoJSON result into single feature.
Overview of work done
Set OpenAPI query parameters required to match API functionality.
Defined a new boolean query parameter called 'compact' in the OpenAPI schema.
Plumbed the 'compact' parameter into the API Lambda function.
Accept=application/json
,output=geojson
, andcompact=true
.Accept=application/geo+json
. Default behavior is to return compact response unlesscompact
is explicitly set tofalse
.Updated documentation for the compact GeoJSON response.
Overview of verification done
Created two new unit tests to test compact response for
application/json
andapplication/geo+json
response. All units test pass.Overview of integration done
Deployed modifications to SIT environment and ran the following queries.
Compact application/json
curl -v --location 'https://soto.podaac.sit.earthdatacloud.nasa.gov/hydrocron/v1/timeseries?feature=Reach&feature_id=63470800171&start_time=2024-02-01T00:00:00%2b00:00&end_time=2024-10-30T00:00:00%2b00:00&fields=reach_id,time_str,wse&compact=true'
*Coordinates removed
Compact application/geo+json
*Coordinates removed
Not compact application/geo+json
*Coordinates removed.
Compact GeoJSON - Nodes
PR checklist:
See Pull Request Review Checklist for pointers on reviewing this pull request