[Maps] geo_shape fit to bounds#64303
Conversation
|
Pinging @elastic/kibana-gis (Team:Geo) |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
There was a problem hiding this comment.
Great! :) 🚒
This is another case where the date-line issue is causing friction.
ES will return bounds that where the min_lon is larger than the max_lon when the coordinates are wrapped. The longitudes should be correctly rotated imho on the ES-side, but maybe Kibana can do a work-around.
The issue is here:
kibana/x-pack/plugins/maps/public/layers/sources/es_source/es_source.js
Lines 178 to 183 in 07bf917
Consider replacing with:
let minLon = esBounds.top_left.lon;
let maxLon = esBounds.bottom_right.lon;
if (minLon > maxLon) {
minLon -= 360;
}
To reproduce the issue:
- download the world-file here https://maps.elastic.co/#file/world_countries
- geojson upload in Maps
- create dfilrter on USA
- fit to data on USA -> data doesn't fit right
|
I created elastic/elasticsearch#55812 to track ES-side |
|
@elasticmachine merge upstream |
| isFilterByMapBounds: () => { | ||
| return false; | ||
| }, | ||
| it('should be false when buffers are the same', async () => { |
There was a problem hiding this comment.
Diff is really noisy for this change. Just removed source from updateDueToExtent signature
| async getBounds(dataFilters) { | ||
| const isStaticLayer = | ||
| !this.getSource().isBoundsAware() || !this.getSource().isFilterByMapBounds(); | ||
| const isStaticLayer = !this.getSource().isBoundsAware(); |
There was a problem hiding this comment.
removed isFilterByMapBounds check. This resulted in weird behavior where Elasticsearch layers would not call geo_bounds unless "dynamic filter" was selected
thomasneirynck
left a comment
There was a problem hiding this comment.
lgtm when green.
Thx @talevy it's happening ;) !
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* [Maps] geo_shape fit to bounds * handle results that cross dateline Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Closes #33509
Elasticsearch has added geo_bounds aggregation support for geo_shape fields. Update kibana to enable fitting to bounds on geo_shape fields