-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Description
Elasticsearch Version
8.2.0
Installed Plugins
No response
Java Version
bundled
OS Version
Elastic Cloud on GCP
Problem Description
We use Mapbox GL JS to retrieve tiles from the new vector tile search API.
Everything work as expected until we try to extrude the features to display it in 3D:
map.addLayer({
id: 'building_layer',
type: "fill-extrusion",
source: 'building_source',
minzoom: 12,
"source-layer": "hits",
paint: {
"fill-extrusion-color": "#00ade6",
"fill-extrusion-height": 2,
},
});
As you can see on the image, the foreground extrusions is missing:
When I decode the tile using node-mapnik I get:
[{"name":"hits","extent":4096,"version":2,"features":[{"type":3,"properties":{"_id":"59633","_index":"building-v1","id":59633,"gross_floor":180,"floor_nb":2,"unit_nb":1,"protected_rank":0,"principal_type":"Zone d'habitation de très faible densité","city_name":"La Tour-de-Peilz"},"geometry":[9,934,5244,26,22,18,6,7,21,17,15]}]},{"name":"meta","extent":4096,"version":2,"features":[{"type":3,"properties":{"_shards.failed":0,"_shards.skipped":0,"_shards.successful":1,"_shards.total":1,"timed_out":false,"took":1},"geometry":[9,0,8192,26,8192,0,0,8191,8191,0,15]}]}]
Then when I try to get the validity report of this tile with node-mapnik I got the following error:
[Error: Vector Tile has POLYGON with first ring clockwise. It is not valid according to v2 of VT spec.]
As @iverase mentionned it here, this looks very similar to the bug fixed in the upstream library you are using and seems the fix has never been released:
wdtinc/mapbox-vector-tile-java#36
Steps to Reproduce
Create any index with a geoshape:
PUT /extrusion_issue
{
"mappings": {
"properties": {
"location": {
"type": "geo_shape"
}
}
}
}
Insert a document with polygon:
POST /extrusion_issue/_doc
{
"location" : {
"type" : "Polygon",
"coordinates" : [
[
[
6.865488747,
46.459649483
],
[
6.865734629,
46.459515699
],
[
6.865794859,
46.45956863
],
[
6.865549366,
46.459702596
],
[
6.865488747,
46.459649483
]
]
]
}
}
Use mapbox GL JS to retrieve the tile form the vector tile search API and extrude the polygon:
map.addLayer({
id: 'building_layer',
type: "fill-extrusion",
source: 'building_source',
minzoom: 12,
"source-layer": "hits",
paint: {
"fill-extrusion-color": "#00ade6",
"fill-extrusion-height": 2,
},
});
Logs (if relevant)
No response