<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">My mistake<div><br></div><div>please disregard</div><div><br></div><div>Norman</div><div><br><div><div>On Jul 5, 2014, at 3:49 PM, Norman Vine <<a href="mailto:nhv@cape.com">nhv@cape.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">This question is better addressed to the QGis-dev list<div>as QGis is promoting the Float32 type to be Float64 type</div><div><br><div><div><a href="https://github.com/qgis/QGIS/blob/master/src/providers/gdal/qgsgdalprovider.cpp#L1103">https://github.com/qgis/QGIS/blob/master/src/providers/gdal/qgsgdalprovider.cpp#L1103</a></div><div><br></div><div><br></div><div> Jul 5, 2014, at 3:43 PM, "G. Allegri" <<a href="mailto:giohappy@gmail.com">giohappy@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">ldd tells me that both QGIS and gdalinfo point to the same gdal libs<div><br></div><div>ldd /usr/bin/qgis.bin | grep gdal</div><div>libgdal.so.1 => /usr/lib/libgdal.so.1 (0x0284b000)</div><div><br></div><div>
ldd /usr/bin/gdalinfo | grep gdal</div><div>libgdal.so.1 => /usr/lib/libgdal.so.1 (0x00c5f000)</div><div><br></div><div>But I must correct about Python. Running it against the right modules it reports raster band data type as GDT_Float32.</div>
<div><br></div><div>In QGIS Float64 comes out here: <a href="https://github.com/qgis/QGIS/blob/master/src/providers/gdal/qgsgdalprovider.cpp#L1076">https://github.com/qgis/QGIS/blob/master/src/providers/gdal/qgsgdalprovider.cpp#L1076</a></div>
<div><br></div><div>giovanni<br><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-05 21:02 GMT+02:00 Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org" target="_blank">even.rouault@mines-paris.org</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le samedi 05 juillet 2014 20:35:45, G. Allegri a écrit :<br>
<div class="">> Given that an ASCII Grid doesn't provide a data type, maybe the driver<br>
> choose the larger one, while the utilities guess it trying to fit the<br>
> values into a smaller type?<br>
<br>
</div>No, GDAL does not do that sort of magic. Are you sure the GDAL version used by<br>
Python is the same as by the utilities ?<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> giovanni<br>
><br>
> 2014-07-05 20:31 GMT+02:00 G. Allegri <<a href="mailto:giohappy@gmail.com">giohappy@gmail.com</a>>:<br>
> > I've debugged it, and it gets Float64 directly from<br>
> > GDALGetRasterDataType( GDALRasterBandH ).<br>
> > I've also tried opening it with Python GDAL and I get Float64.<br>
> > gdalinfo tells me Float32.<br>
> > I will try to send you a subset of it. It's not easy, as it is a heavy<br>
> > ASCII Grid and I don't want to alter it.<br>
> ><br>
> > giovanni<br>
> ><br>
> ><br>
> > 2014-07-05 20:22 GMT+02:00 Even Rouault <<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>>:<br>
> ><br>
> > Le samedi 05 juillet 2014 20:18:50, G. Allegri a écrit :<br>
> >> > Finally I've reached the point: GDAL's driver is opening the ASCII as<br>
> >> > Float64, consequently QGIS treats it this way.<br>
> >> > I wonder why gdalinfo and gdal_translate treat it as Float32<br>
> >> > instead....<br>
> >><br>
> >> If gdalinfo opens it as Float32, then it is Float32 for everybody. I<br>
> >> guess QGIS probably promotes Float32 to Float64.<br>
> >><br>
> >> > giovanni<br>
> >> ><br>
> >> > 2014-07-05 18:53 GMT+02:00 G. Allegri <<a href="mailto:giohappy@gmail.com">giohappy@gmail.com</a>>:<br>
> >> > > The problem was simpler then it appeared: I didn't realize that QGIS<br>
> >> > > output is Float64.<br>
> >> > > Yet I don't know why QGIS chosed to use this data type...<br>
> >> > ><br>
> >> > > giovanni<br>
> >> > ><br>
> >> > ><br>
> >> > > 2014-07-05 17:56 GMT+02:00 Even Rouault<br>
> >> > > <<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a><br>
> >> > ><br>
> >> > > Le samedi 05 juillet 2014 17:25:48, G. Allegri a écrit :<br>
> >> > >> > > QGIS is usually just calls to gdal, which makes this even more<br>
> >> > >> > > mysterious.<br>
> >> > >> ><br>
> >> > >> > Yes, in the end it uses gdal, but it chooses the way blocks are<br>
> >><br>
> >> read<br>
> >><br>
> >> > >> > and written.<br>
> >> > >> > If I remember correctly geotiff final sizes may depend on block<br>
> >> > >> > ordering and memory alignment.<br>
> >> > >><br>
> >> > >> In that instance, the target geotiff has a natural block dimension<br>
> >><br>
> >> which<br>
> >><br>
> >> > >> is a<br>
> >> > >> raster line.<br>
> >> > >> If QGIS writes the geotiff by 256x256 blocks (this is just a guess.<br>
> >><br>
> >> I've<br>
> >><br>
> >> > >> not<br>
> >> > >> verified), the same raster line will be written several times. As<br>
> >> > >> it<br>
> >><br>
> >> is<br>
> >><br>
> >> > >> a compressed geotiff, the resulting raster line will be each time<br>
> >><br>
> >> being<br>
> >><br>
> >> > >> bigger<br>
> >> > >> since the initial zeros will be replaced by actual values. And if<br>
> >> > >> the new size<br>
> >> > >> of the line is bigger than its previous size, the new line will be<br>
> >> > >> rewritten<br>
> >> > >> at the end of the file, losing the space previously occupied.<br>
> >> > >><br>
> >> > >> > Maybe this is the case, QGIS raster provider not doing the best<br>
> >> > >> > at this level? Don't know, but this discussion is for the QGIS<br>
> >> > >> > ml ;)<br>
> >> > >> ><br>
> >> > >> > giovanni<br>
> >> > >> ><br>
> >> > >> > > On 7/5/2014 9:09 AM, G. Allegri wrote:<br>
> >> > >> > > > I agree with you David, I'm surprised too.<br>
> >> > >> > > > Anyway, gdal_translate is run without compression options.<br>
> >> > >> > > > I've written to the QGIS devs (it was the software) to verify<br>
> >> > >> > > > what's happening with its raster file writer code...<br>
> >> > >><br>
> >> > >> --<br>
> >> > >> Geospatial professional services<br>
> >> > >> <a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
> >> > ><br>
> >> > > --<br>
> >> > > Giovanni Allegri<br>
> >> > > <a href="http://about.me/giovanniallegri" target="_blank">http://about.me/giovanniallegri</a><br>
> >> > > Twitter: <a href="https://twitter.com/_giohappy_" target="_blank">https://twitter.com/_giohappy_</a><br>
> >> > > blog: <a href="http://blog.spaziogis.it/" target="_blank">http://blog.spaziogis.it</a><br>
> >> > > GEO+ geomatica in Italia <a href="http://bit.ly/GEOplus" target="_blank">http://bit.ly/GEOplus</a><br>
> >><br>
> >> --<br>
> >> Geospatial professional services<br>
> >> <a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
> ><br>
> > --<br>
> > Giovanni Allegri<br>
> > <a href="http://about.me/giovanniallegri" target="_blank">http://about.me/giovanniallegri</a><br>
> > Twitter: <a href="https://twitter.com/_giohappy_" target="_blank">https://twitter.com/_giohappy_</a><br>
> > blog: <a href="http://blog.spaziogis.it/" target="_blank">http://blog.spaziogis.it</a><br>
> > GEO+ geomatica in Italia <a href="http://bit.ly/GEOplus" target="_blank">http://bit.ly/GEOplus</a><br>
<br>
--<br>
Geospatial professional services<br>
<a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Giovanni Allegri<br><a href="http://about.me/giovanniallegri" target="_blank">http://about.me/giovanniallegri</a><div>Twitter: <a href="https://twitter.com/_giohappy_" target="_blank">https://twitter.com/_giohappy_</a></div>
<div>blog: <a href="http://blog.spaziogis.it/" target="_blank">http://blog.spaziogis.it</a><br>GEO+ geomatica in Italia <a href="http://bit.ly/GEOplus" target="_blank">http://bit.ly/GEOplus</a></div></div>
</div>
_______________________________________________<br>gdal-dev mailing list<br><a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></blockquote></div><br></div></div>_______________________________________________<br>gdal-dev mailing list<br><a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></blockquote></div><br></div></body></html>