<div dir="ltr"><br><div>increasing the limit of MAX_METADATA_LEN is acceptable?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 1, 2015 at 8:07 PM, Rashad M <span dir="ltr"><<a href="mailto:mohammedrashadkm@gmail.com" target="_blank">mohammedrashadkm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Sep 1, 2015 at 5:08 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>Le mardi 01 septembre 2015 16:50:32, Rashad M a écrit :<br>
> Hello all,<br>
><br>
> I have an the following warning from gdal when reading .h5 dataset<br>
><br>
> Warning 2: Header data too long. Truncated.<br>
><br>
> Looking at frmts/hdf5/hdf5dataset.cpp there is a define for<br>
> MAX_METADATA_LEN<br>
><br>
> #define MAX_METADATA_LEN 32768<br>
><br>
><br>
> and there is a check<br>
>                 if( CPLStrlcat(szValue, szData, MAX_METADATA_LEN) >=<br>
><br>
> MAX_METADATA_LEN )<br>
>                     CPLError( CE_Warning, CPLE_OutOfMemory,<br>
>                               "Header data too long. Truncated\n");<br>
><br>
<br>
</span>This was introduced in <a href="https://trac.osgeo.org/gdal/changeset/20438" rel="noreferrer" target="_blank">https://trac.osgeo.org/gdal/changeset/20438</a> to avoid<br>
crashes. Potentially it could be reworked to deal with arbitrary long<br>
metadata. Although it could be kind of annoying to have too long values as<br>
metadata item, especially in the main metadata domain. A cleaner solution<br>
would perhaps be have something like "MY_ITEM=<value removed because too<br>
large. query HDF5 metadata domain to get it>" and you'd have the full value in<br>
the HDF5 metadata domain (perhaps not unlimited but with a much higher limit,<br>
let's say 1 MB per item). People with more experience with HDF5 datasets could<br>
perhaps comment.<br></blockquote><div><br></div></span><div>All of the truncated messages are coming when reading double. Here there is  %.15g. Isn't that too much ?  Could it be reduced or change to simply %g for double.?</div><div><a href="https://trac.osgeo.org/gdal/browser/branches/1.11/gdal/frmts/hdf5/hdf5dataset.cpp#L800" target="_blank">https://trac.osgeo.org/gdal/browser/branches/1.11/gdal/frmts/hdf5/hdf5dataset.cpp#L800</a></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span><br>
> Now I could update MAX_METADATA_LEN but is there a way it can set be set at<br>
> runtime ?<br>
<br>
</span>No, you need to recompile.<br>
<span><font color="#888888"><br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</font></span></blockquote></span></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div><font face="arial, helvetica, sans-serif">Regards,<br>   Rashad</font></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div><font face="arial, helvetica, sans-serif">Regards,<br>   Rashad</font></div></div>
</div>