[gdal-dev] GeoTransform confusion

Simon Lyngby Kokkendorff silyko at gmail.com
Thu Nov 19 01:47:50 PST 2015


I can confirm also that it works when I set a target srs.
But must admit that the current behaviour was confusing. I knew how to
interpret the input data - under the assumption that a geotransform is not
changed when I do no transformations or interpolations:
If I know that my data are "points" rather than "pixels" - the first
"point" is lying half a cellsize downwards and rightwards from the upper
left corner that GDAL reports. That's what I always assume - not relying on
other metadata items than the GeoTransform.

So I agree that it might be worth a ticket.

Cheers,
Simon





On Thu, Nov 19, 2015 at 10:29 AM, Ari Jolma <ari.jolma at gmail.com> wrote:

>
> On 19.11.2015 11:26, Even Rouault wrote:
>
>>
>>
>> GDAL version:
>> GDAL 1.11.2, released 2015/02/10
>> Simon,
>>
>> Regarding the fact that the geotiff file looses the half-pixel shift, it
>> seems
>> to be due to the absence of a SRS. If I do "gdal_translate test.asc
>> test.tif -
>> a_srs EPSG:32630" for example, then the geotransform I get back is
>> correct.
>> This is a defect of the GeoTIFF writer that writes the GeoTIFF Tiepoints
>> with
>> the PixelIsPoint convention (since your original data is flagged as
>> such), but
>> fails to write GTRasterTypeGeoKey=RasterPixelIsPoint as a geotiff key when
>> there's no SRS. Could be worth a ticket.
>>
>
> My conclusion is the same. I think the key should be set regardless of the
> existence of a SRS.
>
> Ari
>
>
>> Some background:
>> https://trac.osgeo.org/gdal/wiki/rfc33_gtiff_pixelispoint
>>
>> A workaround :
>> gdal_translate test.asc test.tif -mo AREA_OR_POINT=AREA
>>
>> This will force the geotiff writer to use the default convention, and thus
>> avoiding going back to the centerofpixel convention when writing the
>> GeoTIFF
>> tiepoints.
>>
>> Even
>>
>>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20151119/3a647eb2/attachment-0001.html>


More information about the gdal-dev mailing list