<div dir="ltr"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 10, 2013 at 12:44 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org" target="_blank">even.rouault@mines-paris.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le mardi 10 décembre 2013 16:48:31, Ivan Lucena a écrit :<br>
<div><div class="h5">> Hi Even,<br>
><br>
> > From: <a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a><br>
> > To: <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
> > Subject: Re: [gdal-dev] Default GeoTransform for MEM driver<br>
> > Date: Mon, 9 Dec 2013 20:54:35 +0100<br>
> > CC: <a href="mailto:lucena_ivan@hotmail.com">lucena_ivan@hotmail.com</a>; <a href="mailto:tkeitt@utexas.edu">tkeitt@utexas.edu</a>; <a href="mailto:jukka.rahkonen@mmmtike.fi">jukka.rahkonen@mmmtike.fi</a><br>
> ><br>
> > Le lundi 09 décembre 2013 18:08:19, Ivan Lucena a écrit :<br>
> > > The other problem with that documentation is the return code. CE_Failue<br>
> > > means that the driver does not support it and/or that the dataset<br>
> > > doesn't have it.<br>
> ><br>
> > The current behaviour of the MEM driver doesn't particularly shock me. It<br>
> > seems OK to return CE_Failure if SetGeoTransform() hasn't been<br>
> > explicitely called to define it. And as far as the default geotransform,<br>
> > it is a matter of taste. [ 0, 1, 0, 0, 0, 1] would be indeed a bit more<br>
> > classical for a ungeoreferenced image, but one can consider that if<br>
> > GetGeoTransform() returns CE_Failure, the returned geotransform is to be<br>
> > ignored.<br>
><br>
> That is good to know. So it really doesn't matter if the driver support<br>
> geotransformation or not.<br>
><br>
> But my concern is when it returns CE_None. What does it really means<br>
> because I was checking some driver's implementation of GetGeoTransform and<br>
> I noticed that some of then always return CE_None no matter what.<br>
> So would<br>
> that be possible that a dataset is *ungeoreferenced* and a driver returns<br>
> CE_None with the default values [0, 1, 0, 0, 0, 1].<br>
> Should we trust that<br>
> those values [0, 1, 0, 0, 0, 1] are correct or are they just a default<br>
> filler?<br>
><br>
> For example, to get [0, 1, 0, 0, 0, 1] we should expect a world-file that<br>
> should be something like:<br>
><br>
> 1.0000000000<br>
> 0.0000000000<br>
> 0.0000000000<br>
> 1.0000000000<br>
> 0.5000000000<br>
> 0.5000000000<br>
><br>
> Not:<br>
><br>
> 1.0000000000<br>
> 0.0000000000<br>
> 0.0000000000<br>
> 1.0000000000<br>
> 0.0000000000<br>
> 0.0000000000<br>
><br>
> Anyway, I will trust that the CE_None means that the geotransformation<br>
> values are correct but should I will also check if the values are equal to<br>
> [0, 1, 0, 0, 0, 1] just in case? And what to do if they are?<br>
<br>
</div></div>I'm not sure to know the ultimate answer to your questions. My understanding<br>
of <a href="http://www.gdal.org/classGDALDataset.html#af9593cc241e7d140f5f3c4798a43a668" target="_blank">http://www.gdal.org/classGDALDataset.html#af9593cc241e7d140f5f3c4798a43a668</a><br>
is that when there's no projection space associated to a raster, it should<br>
return (0,1,0,0,0,1) and CE_Failure. But they are certainly drivers that<br>
return (0,1,0,0,0,1) and CE_None. They should likely be fixed to return<br>
CE_Failure instead. But you can also test if the geotransform is (0,1,0,0,0,1)<br>
since it isn't a likely real geotransform.<br></blockquote><div><br></div><div>It would make things easier if all drivers returned the same default: (0, 1, 0, 0, 0, -1) for any dataset where the transform has not been assigned. (I reworked my test to use the assumption that spatial y and line index y are opposite sign and it works correctly.) I think it should be considered a bug in the docs and any driver the does not return that default. Otherwise users have to add a lot of ugly conditional code.</div>

<div><br></div><div>THK</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
Even<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"><a href="http://www.keittlab.org/" target="_blank">http://www.keittlab.org/</a></div>
</div></div>