Git Product home page Git Product logo

Comments (4)

DanielJDufour avatar DanielJDufour commented on August 26, 2024

It's possible the performance is related to the way georaster is bundling an older version of geotiff.js. Would you be able to see the workaround described here and let me know if that works for you?
GeoTIFF/geoblaze#226 (comment)

Long term, I hope to publish a new version of georaster that fixes this issue, but that may take some time because we're in the middle of a re-write.

from georaster-layer-for-leaflet.

john-a-m avatar john-a-m commented on August 26, 2024

I came to the same conclusion, my workaround right now is to download the data directly (gzip compresses it well) and construct the georasters manually as described here (https://github.com/GeoTIFF/georaster?tab=readme-ov-file#load-from-simple-object-on-front-end). Here is the metadata I'm supplying.

const sizeDegrees = 0.02906874;
const projection = 4326;
const xmin = -124.725839;
const xmax = -66.949895;
const ymin = 24.498131;
const ymax = 49.384358;
const pixelWidth = sizeDegrees;
const pixelHeight = sizeDegrees;
const metadata = { projection, xmin, xmax, ymin, ymax, pixelWidth, pixelHeight };

However I've run into another issue, with a raster 2000x850 that means there are 1.7m unique tiles. Even when I set the resolution to 8 I still have a good deal of lag when panning/zooming. Is there someway to change the way I create the rasters so they work better with GeoRasterLayer? I also tried extending GridLayer the way this plugin does and found out that createTile creates a new div/canvas for every cell 🤮.

As part of your rewrite are you planning to make it so that there is only a single canvas element? If not I think I'll give that a try, if so maybe I'll wait. In any case good luck with your endeavor.

from georaster-layer-for-leaflet.

DanielJDufour avatar DanielJDufour commented on August 26, 2024

@john-a-m , could you try the experimental pre-release version of georaster-layer-for-leaflet and let me know if that improves the performance for you?!

npm install georaster-layer-for-leaflet@next

from georaster-layer-for-leaflet.

john-a-m avatar john-a-m commented on August 26, 2024

It's been a while since I've used nvm/node/npm, here's what I did. I created an empty project and ran npm install georaster-layer-for-leaflet@next everything seemed to install correctly. I looked at scripts in package.json and decided to copy georaster-layer-for-leaflet.min.js from the dist directory to the server. Anecdotally it does seem to run slightly faster, although I did notice there seems to be some "redraw artifacts".
redraw_artifacts

For the resolution/zoom in that picture I would expect the little pixels to be resampled into the bigger pixels. Let me know what you think.

from georaster-layer-for-leaflet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.