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

Add a GeoHeatmapAggregator for geo_shape fields and queries #20665

Closed
sstults opened this issue Sep 27, 2016 · 4 comments
Closed

Add a GeoHeatmapAggregator for geo_shape fields and queries #20665

sstults opened this issue Sep 27, 2016 · 4 comments
Labels
:Analytics/Aggregations Aggregations :Analytics/Geo Indexing, search aggregations of geo points and shapes discuss >feature

Comments

@sstults
Copy link

sstults commented Sep 27, 2016

Describe the feature:

There currently is not a way for ES to provide any kind of analysis over geo_shape fields. Lucene supports the creation of a heatmap at arbitrary granularity through its HeatmapFacetCounter. It was first used in Solr's facet mechanism, but it's usable by any Lucene application. This feature issue adds a metric aggregator GeoHeatmapAggregator to accomplish that.

For example, an aggregation of:

{
    "aggs" : {
        "overlay": { 
            "heatmap" : {
                "field" : "shapes",
                "grid_level" : 4,
                "max_cells" : 100000,
                "geom" : {
                    "geo_shape" : {
                        "shapes" : {
                            "shape" : {
                                "type" : "envelope",
                                "coordinates" : [
                                    [-180,90],
                                    [180,-90]
                                ]
                            },
                            "relation" : "intersects"
                        }
                    }
                }
            }
        }
    }
}

Might produce output similar to:

{
    ...

    "aggregations": {
        "overlay": {
            "grid_level":4,
            "rows":7,
            "columns":6,
            "min_x":45.0,
            "min_y":11.25,
            "max_x":180.0,
            "max_y":90.0,
            "counts": [
                [0,0,2,1,0,0],
                [0,0,1,1,0,0],
                [0,1,1,1,0,0],
                [0,0,1,1,0,0],
                [0,0,1,1,0,0],
                [],
                []
            ]
        }
    }
}
@dsmiley
Copy link
Contributor

dsmiley commented Sep 27, 2016

Just a little correction: "It's meant for use in Solr's facet mechanism" -- no... it's for any Lucene app that might want to calculate heatmaps from the RPT index. Solr was the first Lucene app to use it. If you think there are any Solr-isms or stuff in that functionality you feel doesn't belong, please file a Lucene issue.

@sstults
Copy link
Author

sstults commented Sep 27, 2016

Thanks @dsmiley, the description has been updated.

@sstults
Copy link
Author

sstults commented Oct 5, 2016

I added support for grid level calculation based off of dist_err and dist_err_pct, so I also updated the description of this ticket.

@colings86 colings86 added :Analytics/Aggregations Aggregations :Analytics/Geo Indexing, search aggregations of geo points and shapes discuss >feature labels Mar 21, 2017
@polyfractal
Copy link
Contributor

Closing in favor of #21293.

The request in #21293 seems very similar (aggregating over geo_shapes to provide a heat map of sorts), but should be more general since it's a bucketing aggregation instead of just a metric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations :Analytics/Geo Indexing, search aggregations of geo points and shapes discuss >feature
Projects
None yet
Development

No branches or pull requests

4 participants