[gdal-dev] gdal/proj4 and gtk, SpatialReference.setFromUserInput bug

raigron at fly-n-sense.com raigron at fly-n-sense.com
Fri Jul 5 01:59:47 PDT 2013


Hi,

i'm facing a strange bug in python:

from osgeo import osr
sp = osr.SpatialReference()
sp.SetFromUserInput("IGNF:LAMB2C")
print sp

returns:
PROJCS["unnamed",
     GEOGCS["unnamed ellipse",
         DATUM["unknown",
             SPHEROID["unnamed",6378249.2,293.466021],
             EXTENSION["PROJ4_GRIDS","ntf_r93.gsb,null"]],
         PRIMEM["unnamed",2.337229167],
         UNIT["degree",0.0174532925199433]],
     PROJECTION["Lambert_Conformal_Conic_1SP"],
     PARAMETER["latitude_of_origin",46.8],
     PARAMETER["central_meridian",0],
     PARAMETER["scale_factor",0.99987742],
     PARAMETER["false_easting",600000],
     PARAMETER["false_northing",2200000],
     UNIT["Meter",1]]

which is correct.
But when i import gtk :

from osgeo import osr
import gtk
sp = osr.SpatialReference()
sp.SetFromUserInput("IGNF:LAMB2C")
print sp

PROJCS["unnamed",
     GEOGCS["unnamed ellipse",
         DATUM["unknown",
             SPHEROID["unnamed",6378249,293],
             EXTENSION["PROJ4_GRIDS","ntf_r93.gsb,null"]],
         PRIMEM["unnamed",2],
         UNIT["degree",0.0174532925199433]],
     PROJECTION["Lambert_Conformal_Conic_1SP"],
     PARAMETER["latitude_of_origin",46],
     PARAMETER["central_meridian",0],
     PARAMETER["scale_factor",0],
     PARAMETER["false_easting",600000],
     PARAMETER["false_northing",2200000],
     UNIT["Meter",1]]

the float values seem to have been cast to integers.

I'm using
Gdal: 1.10.0
Proj: 4.8.0
Python: 2.7.5
Gtk: 2.28.6

Note that it works correctly with Proj4.7.0.

Does someone have a clue about what's happening ?
Thanks



More information about the gdal-dev mailing list