1

For visualizing some geodata, we set up a small webserver running leaflet. All works fine, markers and polygons are shown as expected. Now we also want to show large raster files (stored as GeoTiff) as RGB on our map. We have full control over the tif files, we host them ourselves and we can store/process them in any way we want. Still, as they can get rather big in size (up to 30.000x20.000 pixels, three bands) , we are wondering what the best way to do that is.

Options we researched:

  1. Just display them using this plugin, will probably fail because of the size
  2. Store them as Cloud Optimized GeoTIFF: Its not clear to me if leaflet supports this
  3. Use this modified version of gdal2tiles.py
  4. Set up a "regular" tile server (didn't figure out how to do that yet)

As for now, we are only interested in visualization, although it would be a nice bonus if we could extract pixel values a specific location. How is this done nowadays?

edit: if that is important, the images only cover small areas and we only want to show one at a time, so we are not building a map or something, we want to draw them on top of a basemap

2
  • As far as option 4 goes, if you put in the work now to set up a tile server, such as Mapnik, it might pay off in the long run. You'll be able to just add additional images to your setup anytime and render them, no matter how small or large those images. It's probably the most compatible and you can just get an xyz tile service out of it. You could also look at vector tile servers, as this functionality is coming along in Leaflet etc. tileserver.org mapnik.org
    – jhickok
    May 14, 2019 at 21:47
  • also remember you don't want to show "geotiffs" you want to draw image data on leaflet, so always consider option 5: batch-convert your (huge) GeoTIFFs to (small) PNG files, with the filenames telling you the GPS rectangle each image covers (e.g. 24N-130E-25N-129E.png) so you can trivially place them as normal image overlays in leaflet. That said, setting up a tile server is a solved problem so if you need actual map behaviour (with proper tiling at all zoom levels) then that's definitely the way to go. Sep 20 at 21:22

2 Answers 2

5

I found a perfect solution for my case: Terracotta, an open source lightweight Tile Server! Images do not need to be stored in tiled PNGs, but Terracotta servers tiles by reading from cloud-optimized geotiffs. Works like a charm!

2
  • I followed the initial tutorial steps to deploy terracotta but it shows the back map and the bounding box of the tiff but not actual tiff data. what could be the reason!!
    – osmjit
    Jan 6, 2022 at 5:10
  • I solved it the reason that terracotta works with python=3.6 version.
    – osmjit
    Feb 4, 2022 at 15:14
0

You might want to consider the starsTileServer R package that I wrote especially for multidimensional data it is sometimes useful. It basically sets up a tile server from R. Its available on cran

Your Answer

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

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