GeoTIFF / georaster-layer-for-leaflet

Display GeoTIFFs and soon other types of raster on your Leaflet Map
https://geotiff.github.io/georaster-layer-for-leaflet-example/
Apache License 2.0
286 stars 57 forks source link

Speed improvement for drawing smaller tiffs when zoomed in. #9

Closed marcon2 closed 5 years ago

marcon2 commented 5 years ago

When using a high resolution (256, being 1 pixel rectangles if tiles are 256x256) and zooming in, rendering the georaster-layer becomes slow, taking a few seconds per redraw. For smaller TIFFs, too much computation is done, as at some moment each TIFF pixel will be painted as multiple pixels on the screen. And with resolution 256, each screen pixel is painted separately.

In that case, it would not need to compute each screen pixel anymore, but could revert to painting each TIFF pixel.

With this code fix, for 500x500 pixel TIFF the application then remains responsive.

Some counter-arguments could be:

Some details for the attached code:

DanielJDufour commented 5 years ago

I republished https://www.npmjs.com/package/georaster-layer-for-leaflet

marcon2 commented 5 years ago

Thanks again for the quick turn around.

Kind regards,

Marco Nijdam

Principal Consultant

[cid:8a6ea722-81b7-49ab-bdbb-3d3ecaae9851]

West IT Solutions is onderdeel van de Impulsum Group

Tel. +31 15 219 1615 | Mob. +31 620 407 591 marco@west.nl mailto:marco@west.nl | west.nlhttps://www.west.nl/ | Routebeschrijvinghttps://www.google.com/maps/dir/51.9887073,4.3631334/@51.988707,4.363133,14z?hl=nl

https://www.google.com/maps/dir/51.9887073,4.3631334/@51.988707,4.363133,14z?hl=nl

Dit bericht kan vertrouwelijke informatie bevatten. Dit bericht is uitsluitend bestemd voor de geadresseerde. Indien u niet de geadresseerde van dit bericht bent, verzoeken wij u dit direct aan de verzender van dit bericht te melden en dit bericht te vernietigen zonder van de inhoud kennis te nemen. Het is niet toegestaan de inhoud van dit bericht te kopiëren en/of onder derden te verspreiden. Op onze dienstverlening zijn onze algemene voorwaarden van toepassing waarin een beperking van onze aansprakelijkheid is opgenomen. Op uw eerste verzoek zal u gratis een exemplaar worden toegezonden.


Van: Daniel J. Dufour notifications@github.com Verzonden: maandag 12 november 2018 16:27 Aan: GeoTIFF/georaster-layer-for-leaflet CC: Marco Nijdam; Author Onderwerp: Re: [GeoTIFF/georaster-layer-for-leaflet] Speed improvement for drawing smaller tiffs when zoomed in. (#9)

I republished https://www.npmjs.com/package/georaster-layer-for-leaflet

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/GeoTIFF/georaster-layer-for-leaflet/pull/9#issuecomment-437922043, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADWTz1G_Bp_2GuQUXSXanwT3YDNz7_gNks5uuZNvgaJpZM4YZLGP.