<HTML>
<HEAD>
<TITLE>Re: [Geotiff] GeoTIFF geographic grid alignment</TITLE>
</HEAD>
<BODY>
<FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>Dear Max, David,<BR>
<BR>
  Thanks for getting back to me. I see I’m not alone in my confusion.<BR>
I think we all agree that ModelTiePointTag 0.5 offsets (of whatever<BR>
sign) ARE required for RasterPixelIsPoint and ARE NOT required for<BR>
RasterPixelIsArea. This is a big step forward for me!<BR>
<BR>
  We also agree that the ModelPixelScaleTag entries should be positive<BR>
(though I think this is inconsistent with the left-handed I/J system<BR>
and right-handed lon/lat system).<BR>
<BR>
  I would have thought that the offset sign would have to be the same for<BR>
both the I and J directions (and K for that matter) as the handedness<BR>
of the IJK axis system doesn’t have any effect on this. Even though J<BR>
is positive down, the edge of the cell centred on the first point still<BR>
has to start “before” the beginning of the axis, as would be the case<BR>
for I also. Consequently, I’d think both must be negative.<BR>
<BR>
  If the offsets were applied instead to the geographic tie point<BR>
information, then one adjustment would have to be positive (Sx) and<BR>
the other negative (Sy).<BR>
<BR>
  How does this sound?<BR>
<BR>
    Tim.<BR>
<BR>
------------------------------------------------------------------------<BR>
 Tim Nightingale<BR>
  Space Science and Technology Department<BR>
   Rutherford Appleton Laboratory<BR>
    Chilton, Didcot                   Phone: +44/0 1235 445914<BR>
     Oxon OX11 0QX                    Fax:   +44/0 1235 445848<BR>
      United Kingdom                  Email: <a href="tim.nightingale@stfc.ac.uk">tim.nightingale@stfc.ac.uk</a><BR>
------------------------------------------------------------------------ <BR>
<BR>
<BR>
 <BR>
<BR>
<BR>
On 14/05/2010 09:03, "David Burken" <<a href="dburken@comcast.net">dburken@comcast.net</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>Max, Tim,<BR>
<BR>
If your tie upper left corner of the pixel (AREA) and relative to an Easting Northing of (10,000, 10,000) and your pixel scale is (100, 100) meters then to convert to point (center) it would be:<BR>
<BR>
Move the Easting 50 meters to the east or right ( +.5 pixel)<BR>
<BR>
Move the Northing 50 meters to the South or down ( -.5 pixel) <BR>
<BR>
So doing ( -.5, -5 ) is wrong in a map projection.<BR>
<BR>
We actually did a drawing of this on ossim.org to show the error when ignored but I cannot find it. Sorry.<BR>
<BR>
Hope that helps,<BR>
Dave<BR>
<BR>
<BR>
On 05/13/2010 05:15 PM, Max Martinez wrote: <BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>   GeoTIFF geographic grid alignment    <BR>
 <BR>
<BR>
</SPAN></FONT><SPAN STYLE='font-size:10pt'><FONT COLOR="#000080"><FONT FACE="Arial">Tim,<BR>
</FONT></FONT><FONT FACE="Consolas, Courier New, Courier"> <BR>
</FONT><FONT COLOR="#000080"><FONT FACE="Arial"> <BR>
</FONT></FONT><FONT FACE="Consolas, Courier New, Courier"> <BR>
</FONT><FONT COLOR="#000080"><FONT FACE="Arial">I think the GeoTIFF spec tries to show through its examples that although the orientation of the positive J raster space axis is usually in the opposite direction of the positive Y model space axis, it is expected that both pixel scales will be positive under these conditions. (They probably could have been clearer if they described full map extents of the images in the examples). Negation should be used appropriately as the current condition differs from that usual condition. This is also supported by the example on page 27 where the ModelTransformationTag content equivalents of an image with tiepoint (I,J,K,X,Y,Z) and scale (Sx, Sy, Sz) is provided. So I think you have that right in your example.<BR>
</FONT></FONT><FONT FACE="Consolas, Courier New, Courier"> <BR>
</FONT><FONT COLOR="#000080"><FONT FACE="Arial"> <BR>
</FONT></FONT><FONT FACE="Consolas, Courier New, Courier"> <BR>
</FONT><FONT COLOR="#000080"><FONT FACE="Arial">We use a -0.5, -0.5 translation to translate pixel is area to pixel is point just has you have done below.<BR>
</FONT></FONT><FONT FACE="Consolas, Courier New, Courier"> <BR>
</FONT><FONT COLOR="#000080"><FONT FACE="Arial"> <BR>
</FONT></FONT><FONT FACE="Consolas, Courier New, Courier"> <BR>
</FONT><FONT COLOR="#000080"><FONT FACE="Arial">Max<BR>
</FONT></FONT><FONT FACE="Consolas, Courier New, Courier"> <BR>
 
</FONT></SPAN>
<P ALIGN=CENTER>
<FONT SIZE="4"><FONT FACE="Times New Roman"><SPAN STYLE='font-size:12pt'> <BR>
<HR ALIGN=CENTER SIZE="2" WIDTH="100%"></SPAN></FONT></FONT>
<P>
<FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'> <BR>
<BR>
</SPAN></FONT><SPAN STYLE='font-size:10pt'><FONT FACE="Tahoma, Verdana, Helvetica, Arial"><B>From:</B> <a href="geotiff-bounces@lists.maptools.org">geotiff-bounces@lists.maptools.org</a> [<a href="mailto:geotiff-bounces@lists.maptools.org">mailto:geotiff-bounces@lists.maptools.org</a>] <B>On Behalf Of </B><a href="dburken@comcast.net">dburken@comcast.net</a><BR>
 <B>Sent:</B> Monday, May 10, 2010 1:48 PM<BR>
 <B>To:</B> tjn98<BR>
 <B>Cc:</B> <a href="Geotiff@lists.maptools.org">Geotiff@lists.maptools.org</a><BR>
 <B>Subject:</B> Re: [Geotiff] GeoTIFF geographic grid alignment<BR>
</FONT><FONT FACE="Consolas, Courier New, Courier"> <BR>
 <BR>
</FONT></SPAN><FONT SIZE="4"><FONT FACE="Times New Roman"><SPAN STYLE='font-size:12pt'> <BR>
</SPAN></FONT></FONT><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'> <BR>
 <BR>
<BR>
</SPAN></FONT><FONT SIZE="4"><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>Hi,<BR>
 <BR>
If </SPAN></FONT></FONT><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>RasterPixelIsPoint I think it would be (0.5, -0.5).<BR>
 <BR>
Dave<BR>
 <BR>
 </SPAN></FONT><FONT SIZE="4"><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>----- Original Message -----<BR>
From: "tjn98" <<a href="tim.nightingale@stfc.ac.uk">tim.nightingale@stfc.ac.uk</a>> <<a href="mailto:tim.nightingale@stfc.ac.uk">mailto:tim.nightingale@stfc.ac.uk</a>> <BR>
To: <a href="Geotiff@lists.maptools.org">Geotiff@lists.maptools.org</a><BR>
Sent: Monday, May 10, 2010 10:28:07 AM GMT -05:00 US/Canada Eastern<BR>
Subject: [Geotiff] GeoTIFF geographic grid alignment<BR>
 <BR>
 </SPAN></FONT></FONT><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>Dear All,<BR>
 <BR>
  I’m looking for some guidance on the correct interpretation of<BR>
GeoTIFF raster spaces, in particular their correct alignments at the<BR>
half-pixel level. Judging by the number of mutually contradictory<BR>
examples I’ve found, this is a common source of confusion.<BR>
 <BR>
  My interpretation of the rather terse text in the GeoTIFF Format<BR>
Specification (Revision 1.0) is that, for the example of a global<BR>
map measuring 129,600 longitude pixels by 64,800 latitude pixels,<BR>
a “PixelIsArea” raster described by:<BR>
 <BR>
    ModelTiepointTag = (0.0, 0.0, 0.0, -180.0, 90.0, 0.0)<BR>
    ModelPixelScaleTag = (0.002777777778, 0.002777777778, 0.0) <BR>
    GeoKeyDirectoryTag:<BR>
        GTModelTypeGeoKey    = 2    (ModelTypeGeographic)<BR>
        GTRasterTypeGeoKey   = 1    (RasterPixelIsArea)<BR>
        GeographicTypeGeoKey = 4326 (GCS_WGS_84)<BR>
 <BR>
exactly fits into a –180 -> 180 by –90 -> 90 degree box that touches<BR>
the edges of the extreme cell boundaries, and that a “PixelIsPoint”<BR>
raster, whose entries fall exactly in the centre of the “PixelIsArea”<BR>
cells in the first example is described by:<BR>
 <BR>
    ModelTiepointTag = (-0.5, -0.5, 0.0, -180.0, 90.0, 0.0)<BR>
    ModelPixelScaleTag = (0.002777777778, 0.002777777778, 0.0) <BR>
    GeoKeyDirectoryTag:<BR>
        GTModelTypeGeoKey    = 2    (ModelTypeGeographic)<BR>
        GTRasterTypeGeoKey   = 2    (RasterPixelIsPoint)<BR>
        GeographicTypeGeoKey = 4326 (GCS_WGS_84)<BR>
 <BR>
  Variants I have seen include both +0.5 and –0.5 pixel offsets for<BR>
the PixelIsArea case, negative ModelPixelScaleTag values for the<BR>
“J” direction and 0.0 pixel offsets for the PixelIsPoint case. QGIS,<BR>
for example, appears to assume the last.<BR>
 <BR>
  Can anyone help?<BR>
 <BR>
    Many thanks,<BR>
 <BR>
      Tim.<BR>
 <BR>
------------------------------------------------------------------------<BR>
 Dr T.J. Nightingale<BR>
  Space Science and Technology Department<BR>
   Rutherford Appleton Laboratory<BR>
    Chilton, Didcot                   Phone: +44/0 1235 445914<BR>
     Oxon OX11 0QX                    Fax:   +44/0 1235 445848<BR>
      United Kingdom                  Email: <a href="tim.nightingale@stfc.ac.uk">tim.nightingale@stfc.ac.uk</a><BR>
------------------------------------------------------------------------ <BR>
 <BR>
 <BR>
 <BR>
 <BR>
</SPAN></FONT></BLOCKQUOTE></BLOCKQUOTE>

<br><p>-- 
<BR>Scanned by iCritical.
</p>
<br></BODY>
</HTML>