[Geotiff] GeoTIFF geographic grid alignment

David Burken dburken at comcast.net
Fri May 14 08:39:40 EST 2010


Max, see below:

On 05/14/2010 06:12 AM, tjn98 wrote:
> Dear Max, David,
>
>   Thanks for getting back to me. I see I'm not alone in my confusion.
> I think we all agree that ModelTiePointTag 0.5 offsets (of whatever
> sign) ARE required for RasterPixelIsPoint and ARE NOT required for
> RasterPixelIsArea. This is a big step forward for me!
>
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.

So given scale of 50,50 then:
Area tie of (0, 0) (10000, 10000) is the same as:
Point tie of (0, 0) (10050, 9950)

Here are two images one point and one area.  They contain the exact same 
image data and should swipe perfectly.

$ ossim-info -d area.tif | grep tie
tiff.image0.model_tie_point: 0.000000000000000 0.000000000000000 
0.000000000000000 537855.000000000000000 3964495.000000000000000 
0.000000000000000

$ ossim-info -d point.tif | grep tie
tiff.image0.model_tie_point: 0.000000000000000 0.000000000000000 
0.000000000000000 537860.000000000000000 3964490.000000000000000 
0.000000000000000

$ ossim-info -d point.tif | grep scale
tiff.image0.model_pixel_scale: 10.000000000000000 10.000000000000000 
0.000000000000000

$ ossim-info -d area.tif | grep scale
tiff.image0.model_pixel_scale: 10.000000000000000 10.000000000000000 
0.000000000000000

Hope that helps,
Dave


>   We also agree that the ModelPixelScaleTag entries should be positive
> (though I think this is inconsistent with the left-handed I/J system
> and right-handed lon/lat system).
>
Yes positive
>   I would have thought that the offset sign would have to be the same for
> both the I and J directions (and K for that matter) as the handedness
> of the IJK axis system doesn't have any effect on this. Even though J
> is positive down, the edge of the cell centred on the first point still
> has to start "before" the beginning of the axis, as would be the case
> for I also. Consequently, I'd think both must be negative.
>
>   If the offsets were applied instead to the geographic tie point
> information, then one adjustment would have to be positive (Sx) and
> the other negative (Sy).
>
>   How does this sound?
>
>     Tim.
>
> ------------------------------------------------------------------------
>  Tim Nightingale
>   Space Science and Technology Department
>    Rutherford Appleton Laboratory
>     Chilton, Didcot                   Phone: +44/0 1235 445914
>      Oxon OX11 0QX                    Fax:   +44/0 1235 445848
>       United Kingdom                  Email: tim.nightingale at stfc.ac.uk
> ------------------------------------------------------------------------
>
>
>
>
>
> On 14/05/2010 09:03, "David Burken" <dburken at comcast.net> wrote:
>
>     Max, Tim,
>
>     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:
>
>     Move the Easting 50 meters to the east or right ( +.5 pixel)
>
>     Move the Northing 50 meters to the South or down ( -.5 pixel)
>
>     So doing ( -.5, -5 ) is wrong in a map projection.
>
>     We actually did a drawing of this on ossim.org to show the error
>     when ignored but I cannot find it. Sorry.
>
>     Hope that helps,
>     Dave
>
>
>     On 05/13/2010 05:15 PM, Max Martinez wrote:
>
>           GeoTIFF geographic grid alignment
>
>
>         Tim,
>
>
>
>         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.
>
>
>
>         We use a -0.5, -0.5 translation to translate pixel is area to
>         pixel is point just has you have done below.
>
>
>
>         Max
>
>
>         ------------------------------------------------------------------------
>
>
>
>         *From:* geotiff-bounces at lists.maptools.org
>         [mailto:geotiff-bounces at lists.maptools.org] *On Behalf Of
>         *dburken at comcast.net
>         *Sent:* Monday, May 10, 2010 1:48 PM
>         *To:* tjn98
>         *Cc:* Geotiff at lists.maptools.org
>         *Subject:* Re: [Geotiff] GeoTIFF geographic grid alignment
>
>
>
>
>
>
>         Hi,
>
>         If RasterPixelIsPoint I think it would be (0.5, -0.5).
>
>         Dave
>
>         ----- Original Message -----
>         From: "tjn98" <tim.nightingale at stfc.ac.uk>
>         <mailto:tim.nightingale at stfc.ac.uk>
>         To: Geotiff at lists.maptools.org
>         Sent: Monday, May 10, 2010 10:28:07 AM GMT -05:00 US/Canada
>         Eastern
>         Subject: [Geotiff] GeoTIFF geographic grid alignment
>
>         Dear All,
>
>           I'm looking for some guidance on the correct interpretation of
>         GeoTIFF raster spaces, in particular their correct alignments
>         at the
>         half-pixel level. Judging by the number of mutually contradictory
>         examples I've found, this is a common source of confusion.
>
>           My interpretation of the rather terse text in the GeoTIFF Format
>         Specification (Revision 1.0) is that, for the example of a global
>         map measuring 129,600 longitude pixels by 64,800 latitude pixels,
>         a "PixelIsArea" raster described by:
>
>             ModelTiepointTag = (0.0, 0.0, 0.0, -180.0, 90.0, 0.0)
>             ModelPixelScaleTag = (0.002777777778, 0.002777777778, 0.0)
>             GeoKeyDirectoryTag:
>                 GTModelTypeGeoKey    = 2    (ModelTypeGeographic)
>                 GTRasterTypeGeoKey   = 1    (RasterPixelIsArea)
>                 GeographicTypeGeoKey = 4326 (GCS_WGS_84)
>
>         exactly fits into a --180 -> 180 by --90 -> 90 degree box that
>         touches
>         the edges of the extreme cell boundaries, and that a
>         "PixelIsPoint"
>         raster, whose entries fall exactly in the centre of the
>         "PixelIsArea"
>         cells in the first example is described by:
>
>             ModelTiepointTag = (-0.5, -0.5, 0.0, -180.0, 90.0, 0.0)
>             ModelPixelScaleTag = (0.002777777778, 0.002777777778, 0.0)
>             GeoKeyDirectoryTag:
>                 GTModelTypeGeoKey    = 2    (ModelTypeGeographic)
>                 GTRasterTypeGeoKey   = 2    (RasterPixelIsPoint)
>                 GeographicTypeGeoKey = 4326 (GCS_WGS_84)
>
>           Variants I have seen include both +0.5 and --0.5 pixel
>         offsets for
>         the PixelIsArea case, negative ModelPixelScaleTag values for the
>         "J" direction and 0.0 pixel offsets for the PixelIsPoint case.
>         QGIS,
>         for example, appears to assume the last.
>
>           Can anyone help?
>
>             Many thanks,
>
>               Tim.
>
>         ------------------------------------------------------------------------
>          Dr T.J. Nightingale
>           Space Science and Technology Department
>            Rutherford Appleton Laboratory
>             Chilton, Didcot                   Phone: +44/0 1235 445914
>              Oxon OX11 0QX                    Fax:   +44/0 1235 445848
>               United Kingdom                  Email:
>         tim.nightingale at stfc.ac.uk
>         ------------------------------------------------------------------------
>
>
>
>
>
>
> -- 
> Scanned by iCritical.
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/geotiff/attachments/20100514/9ba4cc14/attachment-0001.htm 


More information about the Geotiff mailing list