<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi Even,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Random rasters are indeed fairly common functionality, and used for instance in dynamic simulations, synthetic landscape generation and some Monte Carlo type statistical approaches. </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Having the random raster as a VRT does make sense to me, it would side-by-side with other generated raster types. I also agree that it would be preferred over having yet another raster format, especially if it is not-really-a-data-format. </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I am not sure if I understand your suggestion correctly. Are you suggesting to change the behaviour or VRT DerivedRasterBand in general so that its IRasterIO would only work on block boundaries? That seems quite drastic to me. I think there would be a few more
minor adaptations necessary for VRTDerivedRasterBand so that it can accept that there are zero source layers for the pixel function. </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Looking at VRTDerivedRasterband I was surprised that it implements IRasterIO rather than IReadBlock. If you indeed meant to restrict IRasterIO to block boundaries in general, would it be a consideration to implement it as IReadBlock and use default behaviour
for IRasterIO? From my understanding that would change the way the caching works, as it would cache the results of the pixel function rather than the input to the pixel function. It would also allow RasterIO to still be used as it currently is.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
If you would leave it as IRasterIO, would the random values be cached at all? Or always just generated when requested? </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Kind regards, Alex</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div id="divRplyFwdMsg">
<div style="direction: ltr; font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
<b>From:</b> Even Rouault <even.rouault@spatialys.com></div>
<div style="direction: ltr; font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<b>Sent:</b> 05 July 2025 13:44<br>
<b>To:</b> Alex Hagen-Zanker <alexhighviz@hotmail.com>; gdal-dev@lists.osgeo.org <gdal-dev@lists.osgeo.org><br>
<b>Subject:</b> Re: [gdal-dev] Random Raster Driver</div>
<div style="direction: ltr;"> </div>
</div>
<p style="margin-top: 0px; margin-bottom: 0px;">Alex,</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;">I'm not super familiar myself with the usage of such random rasters, but it seems to be fairly common indeed in GIS software, and could likely make sense within GDAL too. I'm wondering if instead of having a new
driver, the random distribution functions could not be exposed as VRT C++ built-in pixel functions (<a style="margin-top: 0px; margin-bottom: 0px;" data-auth="NotApplicable" class="x_moz-txt-link-freetext OWAAutoLink" id="OWA78f0963a-9664-cdeb-6282-24819181b8a4" href="https://gdal.org/en/stable/drivers/raster/vrt.html#built-in-pixel-functions">https://gdal.org/en/stable/drivers/raster/vrt.html#built-in-pixel-functions</a>).
That would make it possible to benefit from all the rest of the VRT infrastructure like setting geospatial information, adding metadata, multiband support etc There would be a bit of tweak to do in the VRTDerivedRasterBand in that case to force it to always
operate on block boundaries (instead of any arbitrary requested window), so that the per-block seed can be used, but that should mostly be a matter of a few lines to add in its IRasterIO() implementation.</p>
<p style="margin-top: 0px; margin-bottom: 0px;" class="elementToProof"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Even</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<div class="elementToProof">Le 04/07/2025 à 19:08, Alex Hagen-Zanker via gdal-dev a écrit :</div>
<blockquote>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi all, </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I implemented a plugin raster format that produces raster of random values using the all the distributions that are offered by the standard library's random header. It is different from other random raster functionality in e.g. ArcGIS or QGIS because it does
not store the data on file but generates blocks of data on-demand. </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Now it is for my own use, but I'd be happy to polish it up if it can become part of GDAL.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
There is documentation here: </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<a data-auth="NotApplicable" class="x_moz-txt-link-freetext OWAAutoLink" id="OWA185c0760-2a6b-aff1-5ed7-a0802e148fb9" href="https://github.com/ahhz/random-raster/blob/main/docs/random_raster_driver.md">https://github.com/ahhz/random-raster/blob/main/docs/random_raster_driver.md</a></div>
<div style="margin-top: 16px; margin-bottom: 16px; max-width: 800px; min-width: 424px;" id="LPBorder_GTaHR0cHM6Ly9naXRodWIuY29tL2FoaHovcmFuZG9tLXJhc3Rlci9ibG9iL21haW4vZG9jcy9yYW5kb21fcmFzdGVyX2RyaXZlci5tZA..">
<table style="border-width: 1px; border-style: solid; border-color: rgb(200, 200, 200); border-radius: 2px; width: 100%;" id="LPContainer862455">
<tbody>
<tr>
<td>
<div style="margin-right: 12px;" id="LPImageContainer862455"><a data-auth="NotApplicable" id="LPImageAnchor862455" href="https://github.com/ahhz/random-raster/blob/main/docs/random_raster_driver.md"><img style="width: 240px; height: 120px; display: block;" height="120" width="240" id="LPThumbnailImageId862455" src="https://opengraph.githubassets.com/6043ab82cae0d7a681691a0536f0523cc36150ff5a466ad797d69782e59b5e8b/ahhz/random-raster"></a></div>
</td>
<td style="width: 100%;">
<div style="margin-right: 8px; margin-bottom: 12px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 21px;" id="LPTitle862455">
<span style="font-weight: 300;"><a style="text-decoration: none;" data-auth="NotApplicable" id="LPUrlAnchor862455" href="https://github.com/ahhz/random-raster/blob/main/docs/random_raster_driver.md">random-raster/docs/random_raster_driver.md at main · ahhz/random-raster</a></span></div>
<div style="margin-right: 8px; margin-bottom: 12px; max-height: 100px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; color: rgb(102, 102, 102);" id="LPDescription862455">
Create GDALDatasets containing rasters of random values, that do not store the values on disk - ahhz/random-raster</div>
<div style="font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; color: rgb(166, 166, 166);" id="LPMetadata862455">
github.com</div>
</td>
</tr>
</tbody>
</table>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Would this be of interest as a GDAL format?</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Kind regards, Alex</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div><br>
</div>
<fieldset class="x_moz-mime-attachment-header"></fieldset>
<pre><div>_______________________________________________
gdal-dev mailing list
<a class="x_moz-txt-link-abbreviated OWAAutoLink" id="OWA42ce8ca7-7119-6467-46fa-78d8642d6c81" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a data-auth="NotApplicable" class="x_moz-txt-link-freetext OWAAutoLink" id="OWAc3c9182f-0fdb-c74e-d6a5-158cd4c0f9e2" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</div></pre>
</blockquote>
<pre><div>--
<a data-auth="NotApplicable" class="x_moz-txt-link-freetext OWAAutoLink" id="OWA0dc20725-366b-25ef-8f6b-54e915a7299c" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</div></pre>
</body>
</html>