1

I have a GEO tiff image. I am want to read the Latitude and Longitude values stored in the tiff file.

using (Stream imageStreamSource = new FileStream(
        imgpath, FileMode.Open, FileAccess.Read, FileShare.Read))
{
    TiffBitmapDecoder decoder = new TiffBitmapDecoder(imageStreamSource,
        BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
    imageStreamSource.Dispose();

    BitmapSource bitmapSource = decoder.Frames[0];
}
if (bitmapsource.Height > 0)
    map.Height = (int)bitmapsource.PixelHeight;

 if (bitmapsource.Width > 0)
    map.Width = (int)bitmapsource.PixelWidth;

from the above code I am able to get Height, Width of the image but how to get the latitude and longitude information of the file, I dint find any properties already available in the TiffBitmapDecoder class. And How to ensure whether a tiff file is geo-referenced or not ?

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
makot
  • 69
  • 4

0 Answers0