<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Sean,</p>
<p>good question. </p>
<p>gdal_create just calls GDALCreate(), and doesn't "burn" any pixel
value by itself, unless you use the -burn switch</p>
<p>Which brings the question to the behavior of GDALCreate() itself.
And I don't think this is specified indeed and behavior will be
driver dependant.<br>
</p>
<p>I would expect most "raw" drivers to zero initialize the dataset,
typically by seeking to the (size of the file - 1)th byte and
writing a single zero, and relying on sparse file mechanisms of
operating systems to also zero-initialize the areas of the file
not explicitly written.</p>
<p>A few "smart" drivers like the GTiff one will write the nodata
value (or 0 if no nodata explicitly set). Either physically in
default mode, or in SPARSE_OK=YES mode, the reading side of the
driver will consider that sparse tiles are initialized to nodata.
The GPKG raster driver will also behave like that (it has actually
an optimization that if you burn a tile to the nodata value, it
will detect that and will not physically write it). The ERDAS
Imagine one also honours implicitly burning the nodata value.<br>
</p>
<p>Hopefully drivers should implement one of the above 2 behaviors.
I'd consider it a bug of a driver if you get random garbage</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 07/02/2024 à 18:13, Sean Gillies via
gdal-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CAOodmJqVBF-f0pX8B4-uQ-nbkfFq9v=pUt06ia0+BLrBEyYsKA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi all,<br>
</div>
<div><br>
</div>
<div>I haven't found a specification for the empty pixel value
of datasets created by, say, gdal_create. Is it format
specific?<br>
</div>
<br>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">Sean Gillies</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>