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

visualize tif ? #122

Open
palmajoao opened this issue Mar 14, 2024 · 4 comments
Open

visualize tif ? #122

palmajoao opened this issue Mar 14, 2024 · 4 comments

Comments

@palmajoao
Copy link

@joewdavies et al, once again this is great stuff! keep up the great work!

Would love to use the GridViz to display some grids and I have a 100m resolution tif that even if I rescale it to 1k yields about 200MB as a CSV. As a tif, it has about 2MB ...

I see that you have some tif files in your assets:
https://github.com/eurostat/gridviz/tree/master/assets/tiff/test

CSVs can be very inefficient as they repeat coordinates of the regular grid. An ASC file would reduce that size a little as the first rows define the grid.

But I can't see any reference to the tif assets usage. Are you planning to have some methods to visualize it?

@jgaffuri
Copy link
Contributor

Hi Joao !

There is currently no (direct) support for tif format with gridviz. We did some testing here:
https://github.com/eurostat/gridviz/blob/master/src/dataset/GeoTIFF.js
using geotiff.js library (https://geotiffjs.github.io/) and it did not happen to be so relevant because tiff files are usually quite large. COG format (https://www.cogeo.org/) could be a good solution (allowing tiling a tiff file and downloading only part of it) but still has strong limitations.

The only operational option is either with a small CSV file, or a bigger one which can be tiled to improve efficiency.
This dedicated gridtiler tool allows decomposing large CSV files into smaller chunks: https://github.com/eurostat/gridtiler to tile it and use it with gridviz.

To transform a big tiff file into tiled CSV format used by gridviz, we developped some processes in java for 100m resolution data over Europe. See this example for copernicus data: https://github.com/eurostat/JGiscoTools/blob/dev/modules/gproc/src/main/java/eu/europa/ec/eurostat/jgiscotools/gisco_processes/gridvizprep/EurElevation.java
but this was not (yet) exposed as a reusable process unfotunatelly. It should come soon !

@jgaffuri
Copy link
Contributor

For TIFF support in gridtiler, see eurostat/gridtiler#3

@jgaffuri
Copy link
Contributor

If your data is freely available, let use know how we could use it as a test case !

@palmajoao
Copy link
Author

@jgaffuri been trying with the gridtiler and programatically works fine. But the 1k resolution still loads slowly, so I was playing with the aggregation function but was rendering weird values... and while digging the gridtiler issues I found this eurostat/gridtiler#7 which made me understood the reason for the weird values.

our data can't be summed when aggregated as it looses meaning. Our data would need to have the MAX (or MODE) of the values in the aggregation, i.e. for each gridcell we have "number of pressures" ranging from 1 to 14. It dos not make sense to sum all gridvalues as it yields a meaningless value.
Do you think eurostat/gridtiler#7 is an easy fix so we can pursue the use of gridviz?

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