Skip to content
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

HARMONY-1970: Fix bbox parsing for EDR cube route. #679

Merged
merged 1 commit into from
Jan 10, 2025
Merged

Conversation

chris-durbin
Copy link
Contributor

Jira Issue ID

HARMONY-1970

Description

Fixes an issue with bbox parsing for the EDR cube route. I also updated versions of dependencies.

Local Test Steps

Verify the bounding box is now parsed correctly for this request: http://localhost:3000/ogc-api-edr/1.1.0/collections/C1233800302-EEDTEST/cube?bbox=-140,20,-50,60&granuleId=G1233800343-EEDTEST&crs=EPSG%3A31975&f=image%2Fpng&datetime=1975-01-02T00%3A00%3A00Z%2F2020-01-01T01%3A00%3A00Z&parameter-name=blue_var

Verify that an invalid bbox field returns a 400 error to the user:
http://localhost:3000/ogc-api-edr/1.1.0/collections/C1233800302-EEDTEST/cube?bbox=-140,20,-50&granuleId=G1233800343-EEDTEST&crs=EPSG%3A31975&f=image%2Fpng&datetime=1975-01-02T00%3A00%3A00Z%2F2020-01-01T01%3A00%3A00Z&parameter-name=blue_var

PR Acceptance Checklist

  • Acceptance criteria met
  • Tests added/updated (if needed) and passing
  • Documentation updated (if needed)
  • Harmony in a Box tested? (if changes made to microservices)

@chris-durbin chris-durbin requested review from ygliuvt, indiejames and vinnyinverso and removed request for ygliuvt January 9, 2025 17:33
expect(result).to.eql([10, 20, 30, 40]);
});

it('parses 6-element bbox correctly', function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice tests.

Copy link
Member

@ygliuvt ygliuvt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally successfully.

An interesting observation is that the request URL in workflow ui becomes http://localhost:3000/ogc-api-edr/1.1.0/collections/C1233800302-EEDTEST/cube?bbox=-140&bbox=20&bbox=-50&bbox=60&granuleId=G1233800343-EEDTEST&crs=EPSG%3A31975&f=image%2Fpng&datetime=1975-01-02T00%3A00%3A00Z%2F2020-01-01T01%3A00%3A00Z&parameter-name=blue_var rather than the original comma separated string for bbox. I think it is ok as the EDR schema actually specified the bbox as an array of numbers.

Copy link
Contributor

@indiejames indiejames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@chris-durbin chris-durbin merged commit a1c0a67 into main Jan 10, 2025
5 checks passed
@chris-durbin chris-durbin deleted the harmony-1970 branch January 10, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants