[Qgis-developer] RasterFileWriter creates 5 times bigger geotiff then gdal_translate

G. Allegri giohappy at gmail.com
Tue Jul 8 02:05:15 PDT 2014


Hi Radim,
it seems so.
If verified that both gdalinfo and qgis.bin are pointing to the same
libgdal:

>ldd /usr/bin/gdalinfo
libgdal.so.1 => /usr/lib/libgdal.so.1

>ldd /usr/bin/qgis.bin
libgdal.so.1 => /usr/lib/libgdal.so.1

Doing a debug sessione I've seen that Float64 is set by GDAL here:
https://github.com/qgis/QGIS/blob/master/src/providers/gdal/qgsgdalprovider.cpp#L1076

Here it is an excerpt of the original ASCII:
https://dl.dropboxusercontent.com/u/13861666/FI_clipped.asc

giovanni


2014-07-08 10:16 GMT+02:00 Radim Blazek <radim.blazek at gmail.com>:

> On Sat, Jul 5, 2014 at 8:17 PM, G. Allegri <giohappy at gmail.com> wrote:
> > Sorry for the buzz. It's not QGIS fault, it's GDAL itself which reads the
> > ASCII Grid as Float64, but I wonder why contrarily gdalinfo and
> > gdal_translate treats it as Float32...
>
> Float64 in QGIS layer properties metadata Data Type and gdalinfo
> giving Float32 on the same file?
>
> Radim
>
> >
> > 2014-07-05 18:56 GMT+02:00 G. Allegri <giohappy at gmail.com>:
> >
> >> I haven't spot tha exact point where this happens but QGIS exports
> >> Float64, even if the origin was Float32.
> >>
> >> giovanni
> >>
> >>
> >> 2014-07-05 16:54 GMT+02:00 G. Allegri <giohappy at gmail.com>:
> >>
> >>> Causally I hit the save as raster dialog, and I tried to export a
> raster
> >>> to layer (coming from an ASCII Grid source) to Geotiff, with no
> creation
> >>> options set.
> >>> The result was a file 3 times bigger then the original ASCII, and 5
> times
> >>> bigger then the Geotiff created by gdal_translate.
> >>>
> >>> gdalinfo on the files give same results (except statistics missing from
> >>> the one created by RasterFileWriter).
> >>> Does gdal_translate do some optimizations that RFW doesn't?
> >>> I wasn't aware that two Geotiffs, apparently with the same properties,
> >>> could be so different in size...
> >>>
> >>> giovanni
> >>>
> >>> --
> >>> Giovanni Allegri
> >>> http://about.me/giovanniallegri
> >>> Twitter: https://twitter.com/_giohappy_
> >>> blog: http://blog.spaziogis.it
> >>> GEO+ geomatica in Italia http://bit.ly/GEOplus
> >>
> >>
> >>
> >>
> >> --
> >> Giovanni Allegri
> >> http://about.me/giovanniallegri
> >> Twitter: https://twitter.com/_giohappy_
> >> blog: http://blog.spaziogis.it
> >> GEO+ geomatica in Italia http://bit.ly/GEOplus
> >
> >
> >
> >
> > --
> > Giovanni Allegri
> > http://about.me/giovanniallegri
> > Twitter: https://twitter.com/_giohappy_
> > blog: http://blog.spaziogis.it
> > GEO+ geomatica in Italia http://bit.ly/GEOplus
>



-- 
Giovanni Allegri
http://about.me/giovanniallegri
Twitter: https://twitter.com/_giohappy_
blog: http://blog.spaziogis.it
GEO+ geomatica in Italia http://bit.ly/GEOplus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140708/89affd0b/attachment-0001.html>


More information about the Qgis-developer mailing list