Frank Warmerdam warmerdam at pobox.com
Thu Oct 4 16:16:38 EDT 2001

Paul Ramsey wrote:
> > Let me know if you need details.
> One quick-and-easy detail you could give is a snippet which instantiates
> the OGR object with a WKT string and then writes out the proj4 string...
> Thanks,
> Paul


Here is a tiny program doing this in C++.  that's what you wanted,

#include "ogr_spatialref.h"

int main()

    OGRSpatialReference      oSRS;
    char                     *pszProj4 = NULL;
    char                     *pszWKT = "GEOGCS[\"WGS

    oSRS.importFromWkt( &pszWKT );

    oSRS.exportToProj4( &pszProj4 );

    printf( "proj.4 = %s\n", pszProj4 );

I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent
PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.

More information about the Proj mailing list