[Gdal-dev] GDAL ImportfromEPSG Error

Frank Warmerdam warmerdam at pobox.com
Tue Apr 25 15:44:24 EDT 2006


Cho Hyun-Kee wrote:
> Hi!
> This is my first time using GDAL.
> I want to set projection information but when I use ImportfromEPSG() 
> function, ogrErr return 6.
> The code is like this,
> 
> #include "include\ogr_spatialref.h"
> void main()
> {
>     OGRSpatialReference CustomCoordinateInform;
>     
>     OGRErr ogrErr;
> 
>     ogrErr = CustomCoordinateInform.importFromEPSG(4001);         // 
> ogrErr = 6
> }
> How can get PCS,GCS Inform using ImportfromEPSG() function???

Cho,

OGR error 6 is OGRERR_FAILURE, a rather generic code.

I suspect the EPSG csv files aren't being found.  You might
try setting the GDAL_DATA environment variable to point to the
gdal/data directory or possibly just before calling importFromEPSG(),
call:

  GDALSetConfigOption( "GDAL_DATA", "C:\\gdal\\data" );

(well with the appropriate path of course).

Best regards,
-- 
---------------------------------------+--------------------------------------
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    | President OSGF, http://osgeo.org




More information about the Gdal-dev mailing list