Opened 8 years ago

Closed 8 years ago

#6242 closed defect (invalid)

Extra EPSG or other auth codes read from cli but not in python

Reported by: alf Owned by: hobu
Priority: normal Milestone:
Component: PythonBindings Version: 1.11.2
Severity: normal Keywords:
Cc:

Description

Hello,

Working with a custom srs, I've stepped through this error from the python bindings: GDAL_ERROR 6: EPSG PCS/GCS code 910003 not found in EPSG support files. Is this a valid EPSG coordinate system?

but I've previously added the extra code and wkt definition into the cubewerx_extra.wkt, and gdalsrsinfo EPSG:910003 returns the correct wkt.

Is there a way to tell osr python module to look at the cubewerx_extra.wkt or other extra srs definition files?

Thanks

Alessandro

Change History (2)

comment:1 by alf, 8 years ago

as GDAL_DATA is not in os.environ, explicitly setting GDAL_DATA dir via os.environGDAL_DATA = r'/usr/share/gdal/' before importing the osr module in python fixes the problem, so the custom code is recognized in osr/ImportFromEPSG.

comment:2 by Even Rouault, 8 years ago

Resolution: invalid
Status: newclosed

You could also use gdal.SetConfigOption('GDAL_DATA', '/usr/share/gdal') before using osr.

Closoing as it seems to be solved

Note: See TracTickets for help on using tickets.