2

I've got a lot of single-band Geotiff files with the GDT_Float32 format and I need to present these over the web, hopefully using a webmap leaflet/mapbox/googlemaps widget where clients can hover over the map and explore the values.

I've been looking at gdal2tiles.py but it resamples everything down to 8-bit png. Converting to 8-bit isn't going to work for me since I need to retain the precision.

Is there a solution out there for creating 32-bit png tiles for a web viewer? Should I be thinking about this another way?

5
  • Just out of curiosity, what sort of information does Geotiff store in the 32 bits? Is this 32-bit color?
    – user1462
    Commented Apr 30, 2016 at 18:06
  • It's a single band so that's functionally grayscale. Think a single 2D array filled with Float32.
    – Raychaser
    Commented Apr 30, 2016 at 19:10
  • 1
    OK, so you really have/need over 4 billion shades of gray? Most people can only distinguish like 50 (I've heard...)
    – user1462
    Commented Apr 30, 2016 at 20:24
  • A fair point. I think visually 255 values would be enough but I don't want to lose the actual values of the raster which correspond to experimental results. Maybe I need to store that information separately? Not really sure how though
    – Raychaser
    Commented Apr 30, 2016 at 23:46
  • 2
    Yeah, you just need to have a set of "original" files at 32-bit colour channels, and a set of "web-ready" files at 8-bit colour. Keep them separate, and have a script to quickly produce the 8-bit ones from the 32-bit ones. Commented May 1, 2016 at 13:02

1 Answer 1

0

As per @IvanSanchez' suggestion I'm going g to have web-ready 8-bit rasters with accompanying json metadata files.

The metadata files have max and min values from the original 32-bit rasters which we use to interpolate the 0-255 values from the 8bit rasters so we can explore the values in real time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.