Trouble understanding GeoTIFF

rjryersonrjryerson Global Mapper UserPosts: 3
edited August 2012 in Elevation Data
Hi all,

If I'm out of place posting this then I'm sorry. I am having trouble understanding how to use the pixel data (16 bit) of a GeoTIFF file. With the tags, I am able to determine the X & Y values of each position quite easily, but the tags contain no information on how to use the pixel data itself. So I wonder, is it implied that the data is metric and that the reference is the ellipsoid that it's projected on?

For an example here is some tag info I have. (I've placed notes in there as well for my own edification)

Tag 33550: ModelPixelScaleTag = (ScaleX, ScaleY, ScaleZ) (0.000833,0.000833,0.000000)
Tag 33922: ModelTiepointTag = (...,I,J,K, X,Y,Z...) (0.000000,0.000000,0.000000,-0.000417,41.000417,0.000000)
Tag 34735: GeoKeyDirectoryTag
{ 1,1,0,7, Version 1 with 7 GeoKeyDirectoryTag's
1024,0,1,2, GTModelTypeGeoKey 2 = ModelTypeGeographic (lat/long)
1025,0,1,2, GTRasterTypeGeoKey 2 = RasterPixelIsPoint
2048,0,1,4326, GeographicTypeGeoKey 4326 = GCS_WGS_84
2049,34737,7,0, GeogCitationGeoKey
2054,0,1,9102, GeogAngularUnitsGeoKey 9102 = Angular_Degree
2057,34736,1,1, GeogSemiMajorAxisGeoKey = 6378137.000000
2059,34736,1,0 } GeogInvFlatteningGeoKey = 298.257224
Tag 34736: 298.257224,6378137.000000
Tag 34737: WGS 84|
Tag 42113: -32768

From this I can determine that the polar radius is a(1 - f) or 6378137.000000 * ( 1 - (1 / 298.257224) or 6356752.3 and the radius @ 41N is 6368976.7282. So that the first pixel will be placed on the ellipsoid (cartesian coords)

x = 4,806,727.7529571129744067982204553
y = 0
z = 4,178,424.6879388101883632003477379

In this case, if I take the pixel data @ 0, 0 of the image, and it turns out to be 256 would that imply that the height value should be 256 meters above the ellipsoid?

The reason I am asking, is that I can not determine what to do with the height values as I do not see anything pertaining to it in the tags and thus it must be implied somehow - I am trying to determine how it's implied and how it works.


Best regards,

Rick

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited August 2012
    Rick,

    I wouldn't worry too much about the ellipsoid information, really the datum determines that. What you care about is the ModelTiepointTag for placing the top left sample and then ModelPixelScale for saying how large each pixel is on the ground. The data will then be a regular grid of values in row major order at the spacing. There are TIFF tags to say the type of data, as well as GeoTIFF tags (which are often missing) for vertical reference information. The heights are likely 2-byte signed short integers or 4-byte floating point values with an elevation relative to some vertical reference frame, like height about the ellipsoid or sea level. That may or may not be there. I would make sure you can extract the height grid the same as Global Mapper does first (or might I suggest using the Global Mapper SDK to do this for you? :), then worry about the vertical reference frame and units.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • rjryersonrjryerson Global Mapper User Posts: 3
    edited August 2012
    The heights are likely 2-byte signed short integers or 4-byte floating point values with an elevation relative to some vertical reference frame, like height about the ellipsoid or sea level. That may or may not be there.

    Mike - thank you for the reply.

    Yes, that's it: I am trying to determine what the vertical reference frame is.

    I'm sure my understanding of GeoTIFF is lacking. I appreciate your participation in this question.


    The complete set of tags are:

    ImageWidth (1 Short): 1201
    ImageLength (1 Short): 1201
    BitsPerSample (1 Short): 16
    Compression (1 Short): Uncompressed
    Photometric (1 Short): MinIsBlack
    StripOffsets (401 Long): 3594, 10800, 18006, 25212, 32418, 39624,...
    SamplesPerPixel (1 Short): 1
    RowsPerStrip (1 Short): 3
    StripByteCounts (401 Long): 7206, 7206, 7206, 7206, 7206, 7206, 7206,...
    PlanarConfig (1 Short): Contig
    SampleFormat (1 Short): 2
    33550 (3 Double):
    33922 (6 Double):
    34735 (32 Short): 1, 1, 0, 7, 1024, 0, 1, 2, 1025, 0, 1, 2,...
    34736 (2 Double):
    34737 (8 ASCII): WGS 84|
    42113 (7 ASCII): -32768
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited August 2012
    You can check for the GeoTIFF tags VerticalCSTypeGeoKey (4096) and VerticalUnitsGeoKey (4099), but they simply aren't there in most elevation GeoTIFF files.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • rjryersonrjryerson Global Mapper User Posts: 3
    edited August 2012
    You can check for the GeoTIFF tags VerticalCSTypeGeoKey (4096) and VerticalUnitsGeoKey (4099), but they simply aren't there in most elevation GeoTIFF files.

    Yeah, I can understand that, loading this same GeoTIFF into Global Mapper shows something is used, there is change in elevation. But since they are missing - what's implied?
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited August 2012
    Global Mapper has several ways of setting elevation units for files that don't specify them. If the file uses a projected system, it will match the vertical units to the ground units, or if the user has to be asked for the projection they are also asked for the elevation units. None of those are fool-proof though, so you might just want to ask up front always if you aren't sure.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
Sign In or Register to comment.