I need to stream large geotiff files through web server. By large I mean 1Gb-3Gb.

The datasets I was given aren not tilled (pixel strips).

I wonder how does it affect efficiency of reading them using GDAL. If I request only part of image - does GDAL load into memory only the relevant part of image? Does the file need to be tilled in order to be read piece by piece?

This is how gdalinfo output look like for typical file I want to read:

Band 1 Block=43554x1 Type=Byte, ColorInterp=Red
  NoData Value=-10000
Band 2 Block=43554x1 Type=Byte, ColorInterp=Green
  NoData Value=-10000
Band 3 Block=43554x1 Type=Byte, ColorInterp=Blue
  NoData Value=-10000
Band 4 Block=43554x1 Type=Byte, ColorInterp=Alpha
  NoData Value=-10000

Question is: if i want to access 512x512 fragemnt will GDAL read (best case scenario) at least 43554x512 pixels? (and allocate at leat that much memory).

  • You're asking about windowed reading, not streaming. This is possibly a duplicate of 2856. The main gotcha with reading them from a web-server v. reading from file system is that the web-server needs to support range requests.
    – user2856
    Oct 6 '16 at 0:47
  • You are right, GDAL must read the affected rows completely into memory first.
    – user30184
    Oct 6 '16 at 4:45

GDAL will read 43554x512 pixels if the image is striped like that. Better than reading the whole image, but not as good as reading from a tiled image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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