eurostat / gridviz

A package for visualizing gridded data 🌐
https://github.com/eurostat/gridviz
European Union Public License 1.2
199 stars 10 forks source link

Zoomed data-grid shows gaps #86

Open wahlatlas opened 1 year ago

wahlatlas commented 1 year ago

Have to investigate further and create example this is 100m-grid-data with wms background.

works as expected in this zoom level adjacent100m

same area as above but zoomed in further. results in data grid showing gaps: zoomed100m

jgaffuri commented 1 year ago

I also observed this bug here: https://eurostat.github.io/gridviz/examples/styles/squarecolorwgl.html It happens for the SquareColorWGLStyle style when the square get very large. I could not find a way to solve it. It seems there is a rounding happening when transferring data to webgl renderer... I will try to investigate again.

A workaround in the meantime is to use shapecolorsize-style which is based on canvas, only from the zoom levels were the bug appears. It is possible to define minZoom and maxZoom at style level. If the shift from webgl to canvas should happen at zoom level 5645, just define the layer styles stack as:

[ new gviz.SquareColorWGLStyle({ ... minZoom : 5645 }), new gviz.ShapeColorSizeStyle({ ... maxZoom : 5645 }) ]

In such a way, webGL will be used above zoom 5645, and canvas below.