[gdal-dev] Fwd: Re: Request for clarification on SPARSE_OK=TRUE and empty tiles relation

Even Rouault even.rouault at spatialys.com
Tue May 17 00:41:51 PDT 2016

(Forwarding to list)

----------  Message transmis  ----------

Sujet : Re: [gdal-dev] Request for clarification on SPARSE_OK=TRUE and empty 
tiles relation
Date : mardi 17 mai 2016, 07:27:24
De : James Ramm <jamessramm at gmail.com>
À : Even Rouault <even.rouault at spatialys.com>

SPARSE_OK only informs the geotiff driver to skip FillEmptyTiles when
flushing the dataset. Most gdal utilities will explicitly write every block.
It may make sense to have an extra option on gdal_translate and other utils
such as --skip_null_blocks or have the explicitly check for the SPARSE_OK
creation option given that it seems intuitive to expect a sparse file to be
created when specifying SPARSE_OK.

On 16 May 2016 at 20:24, Even Rouault <even.rouault at spatialys.com> wrote:

> Daniele,
> > I have seen a recent email on that list about filling empty tiles and
> > SPARSE_OK creation option (titled "Geotiff FillEmptyTiles with no data
> > value")
> > I would like to understand a little better how it works.
> >
> > Suppose I have 2 isolated GeoTiff files of the same datatype, let's say
> one
> > covering California and the other covering France.
> > I do a gdalbuildvrt to mosaic them together and then I convert the VRT to
> > GeoTiff.
> > At which level the SPARSE_OK flag and void blocks management are taken
> into
> > account?
> > I was "hoping" that using the SPARSE_OK=TRUE create option when
> translating
> > VRT to GeoTiff would have resulted into having an output smaller with
> > respect to an output generated without that creation option since there
> is
> > a wide void area in the middle.
> > Why I get the same size in both cases?
> SPARSE_OK=TRUE has only effect when blocks are not written at all. If a
> block
> is written with pixels set to zero (or the no data value), it will still be
> flushed to disk. It would make sense to avoid that I guess.
> > Shouldn't it avoid filling void
> > blocks in the gap?
> > Is the VRT Driver iterating on all the tiles involved in the final
> bounding
> > box so that it forces a write of each block even if there is no source
> > dataset for that tile?
> Actually it is the GeoTIFF driver that iterates over the source dataset. It
> has no knowledge of the fact that the dataset dataset is a VRT and it may
> have
> sparse zones.
> One way to workaround this would be to create an empty sparse target
> of the appropriate size, and then gdalwarp each input dataset into it (with
> Even
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

Spatialys - Geospatial professional services

More information about the gdal-dev mailing list