[GIS] How to read Geotiff tags and pixel per pixel values using GDAL C#

cgdalgeotiff-tiffsrtm

I'm new here and I'm new at programing with GDAL C#.

My question is how I can get the value of SRTM GEOTIFF pixel to compare with it's neighbors, and how can I get the values of Geotiff tags.

Best Answer

You have two questions:

  1. Reading pixel data from the Geotiff: Here you find a C# GDAL Read Raster Code Sample. The final reading method is called Band.ReadRaster!

  2. Reading Geotiff-Tags: Depends which Tags you mean...

    • If you want to read the GeoTransform-Parameters (Georeference-Info), you would do that with the method Dataset.GetGeoTransform.
    • If you want to read the Projection-Parameters, you would do that with Dataset.GetProjectionRef.
    • If you want to read any other Geotiff Tags, forget GDAL and use any other lib, like LibTiff.Net.