[Gdal-dev] OGRSpatialReference::exportToProj4 causes segmentation error

Xiaodong Zhang zhang at aero.und.edu
Wed Jul 28 13:27:53 EDT 2004


One of our code, which works with Gdal 1.1.8 causes a segmentation fault with
newer version of Gdal 1.1.9  and Gdal 1.2.1. It seemed that the following part
causes the problem.

char ** ppProj;
proj = srcDataset->GetProjectionRef();
/* so far is OK after open an image with GDALOpen and get the projection info

OGRSpatialReference hProj(proj); // it is still OK up to here
hProj.exportToProj4 (ppProj); // it crashes here

Also the OGR documentation says to de-allocate ppProj using CPLfree(), how to
use it exactly?


Xiaodong Zhang, Ph.D.
Assistant Professor
Earth System Science and Policy Program
University of North Dakota
Grand Fors, ND 58202-9007

More information about the Gdal-dev mailing list