So I am trying to re-project a coordinate from WGS 84 / UTM zone 33N (Meters) to WGS 84 (DD). I have tried the below method but when it gets to the portion to translate it throws an Unhandled exception at 0x00007ff62fb056d5 in GDALTestApp.exe: 0xC0000005: Access violation reading location 0x0000000000000000. I am using VS 2012 to run an compile. GDAL_DATA directory is set and contains 61 files.
However since there is an access violation where the address is a null pointer,
it would be a good idea to verify that OGRCreateCoordinateTransformation did not return a null pointer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
OGRCoordinateTransformation* coordTrans = OGRCreateCoordinateTransformation(&srFrom, &srTo);
if( coordTrans == 0 )
{
// error: OGRCreateCoordinateTransformation failed null pointer was returned
// print out an error message
// TO DO: identify the cause of the failure; try to fix it etc.
}
else
{
// try to use coordTrans to perform transformations
// ...
}