相关文章推荐
从容的鼠标  ·  vite uncaught ...·  1 年前    · 
酷酷的海豚  ·  在Android ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I have a COG sitting on AWS S3. The COG size is 2.3GB and is validated. I'm reading the COG into Openlayers in a standard method:

// load COG
const cogSource = new GeoTIFF({
  sources: [
      url:url,
  convertToRGB: true,
const cog = new TileLayer({
  crossOrigin: 'anonymous',
  source: cogSource,
  extent: extent,
  title: 'single'

The issue I am currently facing the load time of this COG into the browser. It can take up to five to ten seconds to load the file. Once the COG is loaded, there is no real performance issue. Just the initial load takes a very long time.

Does anyone know if this can actually improved? Whether it be improving the headers structure of the COG or leveraging the JS in a different manner?

Site loading the COG: https://dragonfly-science.github.io/qgis-cog-tiler/ JS for the site: https://github.com/dragonfly-science/qgis-cog-tiler/blob/main/web-docs/main.js

This question may be too broad, but I need to start somewhere.

I've tried:

  • Using different internal tile sizes. This seems to help with the tif header size
  • Placing the COG behind a CDN in the hopes pre-caching might speed things up
  • Different compressions on the internal images. Sort of helps
  • I understand this my not totally be an issue specific to Openlayers, but I have found that even on my most optimized COGs, load times still lag.

    How fast is your internet connection (or your users' internet connection)? See: How long should it take to download a 2 GB file? – geocodezip Mar 9 at 4:18

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.