[gdal-dev] Extra Decimal places added to ASCII gdal_translate mosaic
Even Rouault
even.rouault at mines-paris.org
Tue Mar 11 02:44:58 PDT 2014
>
> Hi Even,
> Thanks for the information. I don't pretend to understand the fine details
> of floats, but it does seem counter intuitive that a simple 2 or 3 decimal
> places can't be accurately represented.
Yes this is really counter intuitive. I've just tested with the Python console
that 50.597 has no exact representation in Float64, which is not completely
unexpected. It is returned as "50.597000000000001". And
>>> 50.597 == 50.597000000000001
True
>>> 50.597 == 50.597000000000002
True
This doesn't explain however why you get 50.596895342423. So I suspect that it
is your input that has 50.596895342423 as a value.
>
> I tried the Float64 but the values are identical (16 significant figures)
> even though the filesize is predictably larger.
>
> I guess I'll have to make do, but it does introduce the problem of False
> Precision.
Very few formats take into account precision. And the GDAL/OGR model has
currently no explicit support for that.
Even
More information about the gdal-dev
mailing list