<div>Hi Frank,</div>
<div> In that case all the handling for the CSK product should go on the Open() method from hdf5imagedataset? Is there any way to avoid polluting the hdf5imagedataset with all the subproduct's constants? Shall I define Product specific private methods as: getCSKGeotransform() to get the information?<br>
</div>
<div>regards</div>
<div> </div>
<div class="gmail_quote">2011/7/4 Frank Warmerdam <span dir="ltr"><<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">On Mon, Jul 4, 2011 at 8:52 AM, Alex Mantaut<br><<a href="mailto:alexmantaut@suremptec.com.ar">alexmantaut@suremptec.com.ar</a>> wrote:<br>> I would like to ask what would be the best way to implement a driver<br>
> that handles HDF5 subproducts, in a way that it doesn't interfere with the<br>> behavior for hdf5 for files that ain't from any specific product type, and<br>> allows to add new product types easly... (It's quite likely I will have to<br>
> add a new hdf5 product type soon)<br>><br>> Because hdf5 products are just hdf5 files with a special order in the<br>> metadata, I think that the code to interpret them should go in the<br>> hdf5dataset (or hdf5imagedataset) to reuse the code that opens the files...<br>
> Is this okay?<br>><br>> If the code for subproducts should go on the hdf5dataset (or<br>> hdf5imagedataset) I have a doubt about design...<br><br></div>Alex,<br><br>We have a similar issue in the HDF4 driver. The approach there has<br>
roughly been to have one or some data items in the HDF4Dataset<br>class (or perhaps HDF4ImageDataset) which enumerates what the<br>product is, with a generic option for anything which isn't special<br>product.<br><br>
The Open() method has special logic to identify products, and<br>harvest extra metadata depending on the product type. Rather<br>than create subdriver's I'd suggest such using this approach,<br>and perhaps having one 'metadata harvest" method on the<br>
driver for each subproduct. In many cases that is sufficient.<br><br>I look forward to seeing your patches!<br><br>Best regards,<br><font color="#888888">--<br>---------------------------------------+--------------------------------------<br>
I set the clouds in motion - turn up | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a><br>light and sound - activate the windows | <a href="http://pobox.com/~warmerdam" target="_blank">http://pobox.com/~warmerdam</a><br>
and watch the world go round - Rush | Geospatial Programmer for Rent<br></font></blockquote></div><br><br clear="all"><br>-- <br>--<br> Alex Mantaut<br>SUR Emprendimientos Tecnológicos<br><br>Perú 345 Piso 5to Oficina "B" (C1067AAG)<br>
Ciudad de Buenos Aires, Argentina<br>Tel. +54 (11) 4342-2976/84<br><a href="mailto:alexmantaut@suremptec.com.ar" target="_blank">alexmantaut@suremptec.com.ar</a><br><a href="http://www.suremptec.com/" target="_blank">www.suremptec.com</a><br>