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

Aggregation #276

Merged
merged 20 commits into from
Jul 14, 2024
Merged

Aggregation #276

merged 20 commits into from
Jul 14, 2024

Conversation

jamesfisher-geo
Copy link
Collaborator

@jamesfisher-geo jamesfisher-geo commented Jul 1, 2024

Related Issue(s):

Description:
Adds support for The Aggregation Extension with an added dependency on the Filter Extension. This enables geo-aggregation of geometries and points, taking advantage of Opensearch and Elasticsearch's aggregation engines.

Note that some of the geo-aggregation features will have to be left untested on the Elasticsearch backend implementation because they require a commercial license.

TO DO:

  • Need to support collection aggregations using the <collection ID>/aggregate route. Add support in the aggregate function in the core aggregations extension.

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable
  • Changes are added to the changelog

@jamesfisher-geo
Copy link
Collaborator Author

This is ready for review @jonhealy1. Kind of a big PR 😄.

I know there are some class formatting changes coming down the line from stac-fastapi. I'm open to making any required changes in a separate PR when we bump the stac-fastapi version to 3.0.0b2

@jamesfisher-geo
Copy link
Collaborator Author

FYI @philvarner

Comment on lines 772 to 778
# if "geometry_geohex_grid_frequency" in aggregations:
# search_body["aggregations"]["geometry_geohex_grid_frequency"] = {
# "geohex_grid": {
# "field": "geometry",
# "precision": geometry_geohex_grid_precision,
# }
# }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi. Is this meant to be commented out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, It is a placeholder for when OS/ES add geohex aggregation for geo_shape geometries

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is a bit confusing to have it in the code, though. I do not know when that feature is coming to OS/ES, so I'll remove the commented out code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can leave the code in if you want - just add a comment explaining why it's commented out

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay. I don't see it on any scheduled release for opensearch. So I'll leave it out

Copy link
Collaborator

Choose a reason for hiding this comment

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

it's not AFAIK -- maybe file another GH issue and pop the code that was removed in there, so it's available in future.

Copy link
Collaborator

@jonhealy1 jonhealy1 left a comment

Choose a reason for hiding this comment

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

Really nice work here. I think everything looks really good 💯

@jonhealy1 jonhealy1 merged commit ee365ab into main Jul 14, 2024
5 checks passed
@jamesfisher-geo jamesfisher-geo deleted the aggregation branch July 19, 2024 16:00
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