<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Max, see below:<br>
<br>
On 05/14/2010 06:12 AM, tjn98 wrote:
<blockquote cite="mid:C812E0A4.7526%25tim.nightingale@stfc.ac.uk"
 type="cite">
  <title>Re: [Geotiff] GeoTIFF geographic grid alignment</title>
  <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>
  </span></font></blockquote>
You can have a tie of 0,0 or any other value and be point or area.  The
point/area just tells the application that the tie is relative to the
center(point) or upper left.<br>
<br>
So given scale of 50,50 then:<br>
Area tie of (0, 0) (10000, 10000) is the same as:<br>
Point tie of (0, 0) (10050, 9950)<br>
<br>
Here are two images one point and one area.  They contain the exact
same image data and should swipe perfectly.  <br>
<br>
$ ossim-info -d area.tif | grep tie<br>
tiff.image0.model_tie_point: 0.000000000000000 0.000000000000000
0.000000000000000 537855.000000000000000 3964495.000000000000000
0.000000000000000 <br>
<br>
$ ossim-info -d point.tif | grep tie<br>
tiff.image0.model_tie_point: 0.000000000000000 0.000000000000000
0.000000000000000 537860.000000000000000 3964490.000000000000000
0.000000000000000 <br>
<br>
$ ossim-info -d point.tif | grep scale<br>
tiff.image0.model_pixel_scale: 10.000000000000000 10.000000000000000
0.000000000000000 <br>
<br>
$ ossim-info -d area.tif | grep scale<br>
tiff.image0.model_pixel_scale: 10.000000000000000 10.000000000000000
0.000000000000000 <br>
<br>
Hope that helps,<br>
Dave<br>
<br>
<br>
<blockquote cite="mid:C812E0A4.7526%25tim.nightingale@stfc.ac.uk"
 type="cite"><font face="Consolas, Courier New, Courier"><span
 style="font-size: 10pt;">  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>
  </span></font></blockquote>
Yes positive<br>
<blockquote cite="mid:C812E0A4.7526%25tim.nightingale@stfc.ac.uk"
 type="cite"><font face="Consolas, Courier New, Courier"><span
 style="font-size: 10pt;">  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 moz-do-not-send="true"
 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 moz-do-not-send="true"
 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 size="2" width="100%" align="CENTER"></span></font></font>
      </p>
      <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
 moz-do-not-send="true" href="geotiff-bounces@lists.maptools.org">geotiff-bounces@lists.maptools.org</a>
[<a moz-do-not-send="true"
 href="mailto:geotiff-bounces@lists.maptools.org">mailto:geotiff-bounces@lists.maptools.org</a>]
      <b>On Behalf Of </b><a moz-do-not-send="true"
 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 moz-do-not-send="true" 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 moz-do-not-send="true"
 href="tim.nightingale@stfc.ac.uk">tim.nightingale@stfc.ac.uk</a>>
<<a moz-do-not-send="true" href="mailto:tim.nightingale@stfc.ac.uk">mailto:tim.nightingale@stfc.ac.uk</a>>
      <br>
To: <a moz-do-not-send="true" 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 moz-do-not-send="true"
 href="tim.nightingale@stfc.ac.uk">tim.nightingale@stfc.ac.uk</a><br>
------------------------------------------------------------------------
      <br>
 <br>
 <br>
 <br>
 <br>
      </span></font></p>
    </blockquote>
  </blockquote>
  <br>
  <p>-- <br>
Scanned by iCritical.
  </p>
  <br>
</blockquote>
<br>
</body>
</html>