0

I am using GDAL to read a geotiff file.

I would like to read the coordinate Z of my geotiff file.

has anyone worked on a case before ?

Regard,

user3548574
  • 87
  • 1
  • 2
  • 10
  • What have you tried so far? What has worked and what hasn't? What have you searched for? What have your found? Stack Overflow works better if you bring a specific programming question. General questions, such as this, tend to produce unsatisfactory answers. – Robᵩ Jul 25 '14 at 13:55
  • I have managed to read the elavation – user3548574 Jul 25 '14 at 14:13
  • Excellent. I see that you have answered your own question. That's good. If that turns out to be the best answer, please accept your own answer. If your answer is insufficient, please update your question to more specifically describe your problem. – Robᵩ Jul 25 '14 at 14:22
  • 1
    possible duplicate of [Read elevation using gdal python from geotiff](http://stackoverflow.com/questions/24956653/read-elevation-using-gdal-python-from-geotiff) – Mike T Jul 27 '14 at 21:27

1 Answers1

0

I have managed to read the elavation from osgeo import gdal

gdal.UseExceptions()

ds = gdal.Open('test_data.tif')
band = ds.GetRasterBand(1)
elevation = band.ReadAsArray()

print elevation.shape
print elevation
user3548574
  • 87
  • 1
  • 2
  • 10