GeoHash plotting in Vega

Hi

whats the best way to plot geo hash values in Vega?

My query:

GET index*/_search?size=0
{
  "aggs" : {
    "large-grid" : {
      "geohash_grid" : {
        "field" : "geoip.location",
          "precision" : 3
      }
    }
  }
}

Results:
"aggregations" : {
"large-grid" : {
"buckets" : [
{
"key" : "9yd",
"doc_count" : 6628672
},
{
"key" : "9qh",
"doc_count" : 1546684
},
{
"key" : "9tb",
"doc_count" : 1502557
},
{
"key" : "dp3",
"doc_count" : 1499205
},

@sushmamagesh I have semi-good and a bad news :slight_smile: converting geohashes into a lat,lng (or getting a bounding box describing that code is a fairly complex thing mathematically. In theory it is possible, but would require some head scratching to get Vega to decode those values. On the other hand, Elasticsearch 7.0 introduces a new geotile_grid aggregation whose key values will be far easier to decode -- they are tile-like, e.g. 5/2/12 (zoom/x/y), so a simple expression would convert it to lat/lng (see stackexchange question or osm wiki). Lastly, we recently had a related ES discussion to support these kinds of cases - so that you can add an expression directly into ES query that would decode those hashes for you, but this is currently at a planning stage.

Perfect. Thanks Yuri. Will try that.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.