Open rkertesz opened 6 years ago
Hey! Dont quite understand coarser grid but smooth looking map? Just use IDW on a coarse grid and use linear interpolation to make it look smooth? Might be possible, I however have no time ATM to work on this unfortunately. But feel free to have a go at it if you would like :)
Thats what i was thinking but there is no way around resampling is there? We are applying this idw on the fly and i want to keep it as fast as possible because the gradient isn't critical but the end product looks too pixelated. Ill think about this
Hm, so Im guessing your data is dynamic and not static? If it were static maybe you could calculate the images in advance? Or you could just precalculate all heatmap tiles in advance and then use them as an additional tilelayer? On another note, you could calculate a distance matrix between the points on first render then figure out the N nearest points (maybe 10 nearest points) from each point, and only use those points instead of doing a global calculation? Could massively speed up things?
I was looking into some raster animation plugins for Leaflet and came across code that seems to do some aggressive smoothing. Do you know if something similar could be done here to allow us to use a coarser grid but maintain a smooth looking map?
from http://apps.socib.es/Leaflet.TimeDimension/examples/example6.html