[gdal-dev] ERROR 6: No translation for an empty SRS

Even Rouault even.rouault at mines-paris.org
Wed Dec 25 10:14:22 PST 2013


Selon Tommaso <tmassimi at hotmail.com>:

> doing some test I see the error is coming from this line
>
> IGNF.ImportFromProj4("+init=IGNF:LAMB2 +wktext")
>
> so it seems that the string is valid for Linux and not
> for windows.
>
> I can't found a list of possible arguments for ImportFromProj4,
> can samebody give me some good link?

The issue must be with proj.4 that does not find the 'IGNF' file that is
normally installed with PROJ.4. Try to find it and set the PROJ_LIB
environmenent variable to point to the directory where IGNF is located.
You can also define the PROJ_DEBUG environmenet variable to ON to see debug
messages of proj.

>
> Thanks in advance
>
>
> From: tmassimi at hotmail.com
> To: gdal-dev at lists.osgeo.org
> Date: Tue, 24 Dec 2013 22:21:37 +0000
> Subject: [gdal-dev] ERROR 6: No translation for an empty SRS
>
>
>
>
> Hi all,
>
> to convert some coordinates from Lambert2 Etendu to WGS84.
> I wrote the small python script you can see below.
>
> It works fine on linux (gdal-1.9.2-5) but it doesn't work on win32
> (GDAL-1.10.1.win32-py2.7.msi and gdal-110-1500-core.msi,downloaded from
>
http://vbkto.dyndns.org/sdk/PackageList.aspx?file=release-1500-gdal-1-10-1-mapserver-6-4-0.zip):
>
> C:\import>python test_coord.py
> ERROR 6: No translation for an empty SRS to PROJ.4 format is known.
> Traceback (most recent call last):
>   File "test_coord.py", line 56, in <module>
>     point.Transform(coordTrans)
>   File "z:\Programmi\python27\lib\site-packages\osgeo\ogr.py", line 4615, in
> Transform
>     return _ogr.Geometry_Transform(self, *args)
> TypeError: in method 'Geometry_Transform', argument 2 of type
> 'OSRCoordinateTransformationShadow *'
>
> env vars are fine:
>
> C:\import>set gd
> GDAL_DATA=c:\programmi\gdal\gdal-data
> GDAL_DRIVER_PATH=c:\programmi\gdal\gdalplugins
>
> what can I do to let the script working on windows too?
>
> ==========
>
> import sys, os
>
> import ogr
> import osr
>
> def getCoord(a,b):
>   WGS = osr.SpatialReference()
>   WGS.ImportFromEPSG(4326)
>   IGNF = osr.SpatialReference()
>   IGNF.ImportFromProj4("+init=IGNF:LAMBE +wktext")
>   coordTrans = osr.CoordinateTransformation(IGNF,WGS)
>   point = ogr.Geometry(ogr.wkbPoint)
>   point.AddPoint(a,b)
>   point.Transform(coordTrans)
>   return point.GetX(), point.GetY()
>
>
> if __name__ == '__main__':
>   print getCoord(602262.89743,2670591.7564)
>   print "expected Lat=51.028160, Lon=2.368641"
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev




More information about the gdal-dev mailing list