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

combining multiple TIFF's into a single TIFFImageryProvider #25

Open
mhaberler opened this issue Jan 25, 2024 · 6 comments
Open

combining multiple TIFF's into a single TIFFImageryProvider #25

mhaberler opened this issue Jan 25, 2024 · 6 comments

Comments

@mhaberler
Copy link

I have a set of 57 RGB TIF's which cover all of Austria, each about 10GB

Do you see a way to combine those into a single TIFFImageryProvider, similar to a GDAL VRT?

or do I need to add each one separately and select the right one?

thanks in advance,

Michael

ps: works great for me - congratulations!

@hongfaqiu
Copy link
Owner

Hello, thank you for your support and encouragement.
This library currently only supports rendering a single TIFF file. Each TIFF file corresponds to a TIFFImageryProvider. If you have multiple TIFF files, you should group them together as a dataset.
When you need to load a specific file, you can create a TIFFImageryProvider and display it on the Cesium globe.

The dataset can be formatted as a simple array, similar to the following format, which can be easily implemented in a frontend project:

type Layer = {
  id: string;
  name: string;
  url: string;
};

type DataSet = {
  id: string;
  name: string;
  layers: Layer[];
}

Nevertheless, loading 57 COG TIFF files of 10GB each onto Cesium puts a significant strain on performance.
If you could test and implement this loading scenario in a similar js library like OpenLayers, please let me know, and I will try to address this performance issue.

@mhaberler
Copy link
Author

@hongfaqiu thanks for the quick reply!

I'll explore your suggestion

I'll also give gdal_merge a try - probably pushing the envelope at 500GB ;)

appreciated - thanks!
Michael

@hongfaqiu
Copy link
Owner

500GB! That's a tremendous amount, and if GDAL slices are too large, it poses a significant performance challenge for the frontend.

Wishing you good luck!

@mhaberler
Copy link
Author

mhaberler commented Jan 25, 2024

what do you think about a tiled approach like so:

  • create a GDAL VRT of the GeoTIFF's
  • run titiler on the VRT
  • massage TIFFImageryProvider to deal with tiled GeoTIFF's

stupid idea or doable?

edit: it seems this project uses titiler-generated tiles - in this case PNG's but not far off

the titiler documentation says it can generate GTIFF's

@hongfaqiu
Copy link
Owner

hongfaqiu commented Jan 26, 2024

@mhaberler In fact, I have a classmate whose thesis is about researching how to manage multiple TIFF files and dynamically split them into tiles in real-time.

I presented these ideas to him about half a year ago, but I am unsure if he has continued researching them. 😂

Here is a demonstration from the official COG team: https://medium.com/devseed/cog-talk-part-2-mosaics-bbbf474e66df.

Edit: I just spoke with the classmate who is working on this research, and he has made significant progress. If you are interested, you can contact him directly at his email address: [email protected].

@hongfaqiu
Copy link
Owner

what do you think about a tiled approach like so:

  • create a GDAL VRT of the GeoTIFF's
  • run titiler on the VRT
  • massage TIFFImageryProvider to deal with tiled GeoTIFF's

stupid idea or doable?

edit: it seems this project uses titiler-generated tiles - in this case PNG's but not far off

the titiler documentation says it can generate GTIFF's

I believe your idea is entirely feasible. It only requires a simple modification by transforming the TIFFImageryProvider into a class similar to UrlTemplateImageryProvider.

This modified class can load and render pre-split TIFF tiles using a URL template format like /cog/tiles/{z}/{x}/{y}.tiff.

However, it would be necessary to provide the band information and spatial extent of the TIFF in advance.

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