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 creating a PNG that is referenced to the OSGB36 datum (1 pixel per 50m easting/northing that is colored according to the result of some calculation code)

I want to display this on Google Earth using KML. But obviously I need to transform the image before I do this.

I can manually use gdal_translate to create a TIF file then gdalwarp to convert the image but I want to achieve this in code (C++) not via external applications.

I looked at the GDAL API but having no joy doing what I can easily do with the aforementioned GDAL utilities.

http://wtp2.appspot.com/warpdemo.htm seems to doing something similar to what I want but having looked at the JavaScript I don't really understand how the affine transformation is being constructed.

Any pointers on how to achieve this would be much appreciated.

share|improve this question
    
wtp2 demo by Bill Chadwick uses the Ordnance Survey OpenSpace API - you can view the javascript code at wtp2.appspot.com/warped_os.js and is pulling the tiles from openspace.ordnancesurvey.co.uk/osmapapi –  Mapperz Jan 29 '13 at 15:35
    
Yes I have seen that. To be honest I can't really work out how the affine transformation is being constructed and how I could modify it for my scenario. –  Alastair Taylor Jan 29 '13 at 20:46
    
In the end I used ShellExecuteEx to run gdalwarp. I would still be interested in a pure C++ code solution but for now this will have to do. –  Alastair Taylor Jan 31 '13 at 17:10
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.