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

Fix cmip6 indicators bbox validation #512

Merged
merged 2 commits into from
Jan 14, 2025
Merged

Conversation

charparr
Copy link
Member

This PR makes a small modification to the CMIP6 Indicators route such that it fetches the spatial bounds from rasdaman and constructs a bounding box to validate the lat-lon of the request.

This should enable locations to have both their CMIP6 data and CMIP6 indicators queried.

To test this PR, make sure you are pointing at datacubes and then try routes like this:

You should get data here:
http://localhost:5000/indicators/cmip6/point/50.5/-147

But not here:
http://localhost:5000/indicators/cmip6/point/49.5/-147

For the latter, the map isn't great but IMO that is OK for now. Also, the bounding box reported on this page is accurate due to the weirdness of the re-grid. However, any requests for latitude 90.1 or something will get caught by this block:

    validation = latlon_is_numeric_and_in_geodetic_range(lat, lon)
    if validation == 400:
        return render_template("400/bad_request.html"), 400

Closes #493

@charparr charparr requested a review from cstephen January 13, 2025 21:05
Copy link
Contributor

@cstephen cstephen left a comment

Choose a reason for hiding this comment

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

Works great! Thanks for the quick fix, @charparr!

@cstephen cstephen merged commit 26d950c into main Jan 14, 2025
@cstephen cstephen deleted the fix_cmip6_indicators_bbox branch January 14, 2025 00:34
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.

Fix BBOX validation for CMIP6 monthly and CMIP6 indicator endpoints
2 participants