mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.06k stars 2.21k forks source link

fill-extrusion-height seems incorrect with terrain #11983

Open geobuilding opened 2 years ago

geobuilding commented 2 years ago

Without terrain https://jsbin.com/kizurex/edit?js,output

image

With terrain https://jsbin.com/vibebum/edit?js,output

image
ubukawa commented 2 years ago

Hello. Thank you mapbox gl js colleagues for your wonderful development.

I am a newbie of terrain 3D, and I have a similar issue of fill-extrusion-height with 3D terrain. So, let me report my case as well.

image With my internal data, I observed an issue of fill extrusion height with 3D terrain. (There was no issue without 3D terrain.) At the tile border, fill-extrusion-height of some buildings are much higher than expected ones.

I cannot open my internal data, so I have prepare some test in the public environment as below.

I know that the terrain height is added to fill-exrusion-height, but I think there are some issues at around the tile border.

At the tile border (for both vector tile source and terrain source): Some buildings are taller than expected. image Left (no terrain 3D): https://ubukawa.github.io/elbox/nyc-no-terrain.html#16/40.784721/-74.003817/-38.1/53 Right (with terrain 3D) : https://ubukawa.github.io/elbox/nyc-terrain.html#16/40.784721/-74.003817/-38.1/53

image Left (no terrain 3D): https://ubukawa.github.io/elbox/nyc-no-terrain.html#15.64/40.814385/-73.936267/0/35 Right (with terrain 3D) : https://ubukawa.github.io/elbox/nyc-terrain.html#15.64/40.814385/-73.936267/0/35

At the tile border (tile border for vector tile but not tile border for terrain source): Some buildings are lower than expected. image

Left (no terrain 3D): https://ubukawa.github.io/elbox/nyc-no-terrain.html#15.99/40.809697/-73.960373/0/46 Right (with terrain 3D) : https://ubukawa.github.io/elbox/nyc-terrain.html#15.99/40.809697/-73.960373/0/46

I would appreciate it if someone could advise me how I can avoid these issues. Thank you!!