Search a vector tile Added in 7.15.0
Search a vector tile for geospatial values.
Path parameters
-
Comma-separated list of data streams, indices, or aliases to search
-
Field containing geospatial data to return
-
Zoom level for the vector tile to search
-
X coordinate for the vector tile to search
-
Y coordinate for the vector tile to search
Query parameters
-
exact_bounds boolean
If false, the meta layer’s feature is the bounding box of the tile. If true, the meta layer’s feature is a bounding box resulting from a geo_bounds aggregation. The aggregation runs on values that intersect the // tile with wrap_longitude set to false. The resulting bounding box may be larger than the vector tile.
-
extent number
Size, in pixels, of a side of the tile. Vector tiles are square with equal sides.
-
grid_agg string
Aggregation used to create a grid for
field
.Values are
geotile
orgeohex
. -
grid_precision number
Additional zoom levels available through the aggs layer. For example, if is 7 and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results don’t include the aggs layer.
-
grid_type string
Determines the geometry type for features in the aggs layer. In the aggs layer, each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon of the cells bounding box. If 'point' each feature is a Point that is the centroid of the cell.
Values are
grid
,point
, orcentroid
. -
size number
Maximum number of features to return in the hits layer. Accepts 0-10000. If 0, results don’t include the hits layer.
-
with_labels boolean
If
true
, the hits and aggs layers will contain additional point features representing suggested label positions for the original features.
Body
-
aggs object
Sub-aggregations for the geotile_grid.
Supports the following aggregation types:
- avg
- cardinality
- max
- min
- sum
-
buffer number
Size, in pixels, of a clipping buffer outside the tile. This allows renderers to avoid outline artifacts from geometries that extend past the extent of the tile.
-
exact_bounds boolean
If false, the meta layer’s feature is the bounding box of the tile. If true, the meta layer’s feature is a bounding box resulting from a geo_bounds aggregation. The aggregation runs on values that intersect the // tile with wrap_longitude set to false. The resulting bounding box may be larger than the vector tile.
-
extent number
Size, in pixels, of a side of the tile. Vector tiles are square with equal sides.
-
fields string | array[string]
-
grid_agg string
Values are
geotile
orgeohex
. -
grid_precision number
Additional zoom levels available through the aggs layer. For example, if is 7 and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results don’t include the aggs layer.
-
grid_type string
Values are
grid
,point
, orcentroid
. -
query object
Additional properties are allowed.
-
runtime_mappings object
-
size number
Maximum number of features to return in the hits layer. Accepts 0-10000. If 0, results don’t include the hits layer.
-
track_total_hits boolean | number
Number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query. Defaults to 10,000 hits.
-
with_labels boolean
If
true
, the hits and aggs layers will contain additional point features representing suggested label positions for the original features.
curl \
-X GET http://api.example.com/{index}/_mvt/{field}/{zoom}/{x}/{y} \
-H "Content-Type: application/json" \
-d '{"aggs":{},"buffer":42.0,"exact_bounds":true,"extent":42.0,"fields":"string","grid_agg":"geotile","grid_precision":42.0,"grid_type":"grid","query":{},"runtime_mappings":{"additionalProperty1":{"fields":{"additionalProperty1":{"type":"boolean"},"additionalProperty2":{"type":"boolean"}},"fetch_fields":[{"field":"string","format":"string"}],"format":"string","input_field":"string","target_field":"string","target_index":"string","script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"type":"boolean"},"additionalProperty2":{"fields":{"additionalProperty1":{"type":"boolean"},"additionalProperty2":{"type":"boolean"}},"fetch_fields":[{"field":"string","format":"string"}],"format":"string","input_field":"string","target_field":"string","target_index":"string","script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"type":"boolean"}},"size":42.0,"":"string","track_total_hits":true,"with_labels":true}'