Skip to content

Add label features to vector tile search API response #86044

@nreese

Description

@nreese

Description

There are 2 labeling issues in Kibana when using Vector tiles.

  1. Multiple labels for MultiPolygon and MultiLineString geometries.
    Screen Shot 2022-04-20 at 9 32 26 AM
  2. Multiple labels for features that span tiles. For example, hexagons that span tile boundaries.
    Screen Shot 2022-04-20 at 9 35 52 AM

The recommended solution is to provide features for labels, where the feature geometry is the label location.

To resolve these issues, I propose adding a new parameter, withLabels, to _mvt API that when true would add label features to the response. Label features could be added in 2 ways

  1. another layer, "label", in the response. The "label" layer will contain Point feature for each hit and agg feature. For agg features, the Point feature will be the center of the hexagon. For hit features, the Point feature will be the centroid of the largest polygon for MultiPolygon and the centroid for the longest line for MultiLineString.
  2. Include label feature in existing "hits" and "aggs" layers. Give label feature a property like "__EsIsLabelFeature" so filter expressions can be used exclude features in style rules.

Kibana is creating these centroid features today for GeoJSON sources. Kibana includes label features in GeoJSON feature collection and uses filters to exclude features in style rules (option 2 above)

cc @jsanz @thomasneirynck

Metadata

Metadata

Assignees

Labels

:Analytics/GeoIndexing, search aggregations of geo points and shapes>enhancementTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions