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.

  • With the Python bindings, I would read the GeoTiff pixel values into a numpy array. Is there equivalent large array access in C#? – DavidF Oct 24 '12 at 14:50
  • Hi DavidF, probably it will work, but in my program I need to use a mask 3x3 who will use to get the image pixels values to compare (or it is what I'm thinking for my porpose). – José Roberto Ribeiro Filho Oct 24 '12 at 19:01

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.