Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am developing an AR iOS application. When the iPhone gets the current location, it has to calculate locally the visible point. I want to read the tiff files in my application, and then get the coordinates and altitudes from it.(locally, offline) I am looking for an open source C++ code, or something like this. Please help

share|improve this question
    
What have you tried so far? –  R.K. Oct 25 '12 at 10:51
    
I have extracted from the TIFF file the coordinates and altitudes using VTBuilder. Now I have a txt file with a size of 1 Gb, but this is too large for a mobile application. I don't know if I am on the right way but probably the txt file can be compressed somehow. It has to be decoded locally when I get the current location.. –  Emese Fabian Oct 25 '12 at 11:25
    
So you get the current coordinate from a GPS fix and then find its corresponding point on the tiff file and put a marker there? –  R.K. Oct 25 '12 at 11:30
    
I get the current coordinate from a GPS fix and using the tiff file, I have to get an array of coordinates of the visible points from my current location, this can be made only by using the altitudes of the coordinates. –  Emese Fabian Oct 25 '12 at 11:35
    
Oh, you'll be doing viewshed analysis on your phone. Libgeotiff should be able to get the coordinates and read the values for you though you'll have to implement a viewshed algorithm. en.wikipedia.org/wiki/Viewshed_Analysis –  R.K. Oct 25 '12 at 11:40

2 Answers 2

With libtiff you can't get altitude from you file. I spent a lot of time trying to do it with libgeotiff. My advice is to install GDAL.

Example:

GDALRasterIO( hBand_ , GF_Read , p, l, 1, 1, &pafScanline, 1, 1, GDT_Float32, 0, 0 );
share|improve this answer

Libgeotiff should do the job.

Libgeotiff is an open source library normally hosted on top of libtiff for reading, and writing GeoTIFF information tags.

I think you'll need CPL_DLL GTIFImageToPCS

Translate a pixel/line coordinate to projection coordinates.

and CPL_DLL GTIFKeyGet

This function reads the value of a single GeoKey from a GeoTIFF file.

share|improve this answer
    
I know the Libgeotiff library but it doesn't have a useful documentation or some examples on how to get data from TIFF files. –  Emese Fabian Oct 25 '12 at 11:40

Your Answer

 
discard

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.