Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Smoothing boundaries? #2

Open
rkertesz opened this issue Feb 27, 2018 · 3 comments
Open

Feature Request: Smoothing boundaries? #2

rkertesz opened this issue Feb 27, 2018 · 3 comments

Comments

@rkertesz
Copy link

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?

var sapoHeightLayer = L.tileLayer.wms(sapoWMS, {
    layers: 'significant_wave_height',
    format: 'image/png',
    transparent: true,
    colorscalerange: '0,3',
    abovemaxcolor: "extend",
    belowmincolor: "extend",
    numcolorbands: 100,
    styles: 'areafill/scb_bugnylorrd'
        // styles: 'areafill/scb_greens'
});

from http://apps.socib.es/Leaflet.TimeDimension/examples/example6.html

@spatialsparks
Copy link
Owner

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 :)

@rkertesz
Copy link
Author

rkertesz commented Mar 2, 2018

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

@spatialsparks
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants