[Qgis-user] precision Identify Features tool
Paulo van Breugel
p.vanbreugel at gmail.com
Wed Apr 13 11:37:30 PDT 2016
On Wed, Apr 13, 2016 at 8:19 PM, Even Rouault <even.rouault at spatialys.com>
wrote:
> Le mercredi 13 avril 2016 20:05:27, Paulo van Breugel a écrit :
> > I just opened a raster layer (asci layer), with real numbers with 6
> > decimals.
> >
> > When click with the 'Identify Features' tool on a raster cell it shows
> many
> > more decimals, e.g., 83.32058715820312 for a raster cell that has value
> > 83.320587 (as can be easily checked by opening the layer as text file).
> >
> > Any idea what I am missing here?
>
> The raster is probably recognized as a Float32 raster (or is exposed as
> Float64), but the Identify tool displays with the precision of a 64-bit
> floating point number. And due to how floating point computation works, the
> extension from 32 to 64 bit is done with working with the IEEE-754 binary
> representation and not the decimal representation, hence 83.320587f gets
> converted as 83.32058715820312.
>
> For example with Python :
> print struct.unpack('f', struct.pack('f', 83.320587))
> (83.32058715820312,)
>
> If the raster is exposed as a Float32 (which is likely if it is recognized
> by
> the AAIGRID driver : http://gdal.org/frmt_various.html#AAIGrid ), then the
> Identify tool could be improved to respect this precision.
>
Using gdalinfo shows that the raster layer is recognized as Type=Float32.
Would be good if the Identify tool could respect this precision.
Just to add, if I upload the raster values to a point layer (using
v.what.rast.points), the correct numbers (with the right number of
decimals) are uploaded.
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20160413/60d604ad/attachment.html>
More information about the Qgis-user
mailing list