Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get an elevation profile from a geotif file ( downloaded from I downloaded the libgeotiff library but i can's see any function that can return an elevation for given pixel/coordinate or any useful documentation/example to how to do that. Can someone help me out how to get the elevation? i want to do it in c\c++

share|improve this question
Are you interested in extracting the profile using a linear feature or just the elevation at a given pixel? Do you know the start / end coordinates (GCS or PCS) of the profile? – Jay Laura Dec 2 '12 at 18:20
up vote 1 down vote accepted

if gdal can help you, you can check out my answer here. beside this there are some python codes in here. you can convert it to c++..

With gdallocationinfo, we can query the elevation at one point :

$ gdallocationinfo gmted/all075.vrt -geoloc 2 49 Report: Location: (87360P,19679L) Band 1: gmted/30N000E_20101117_gmted_bln075.vrt Value: 183

i hope it helps you...

share|improve this answer
gdallocationinfo was the key:D thanks for pointing me to the right direction ;) – Fulop Barna Apr 22 '13 at 12:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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