How to convert Lambert 93 to longitude and latitude with python 3

Published: April 03, 2018

DMCA.com Protection Status

To convert Lambert 93 coordinates to longitude and latitude with python, there is the package pyproj. Example of code with Lambert 93 coordinates(x1,y1) = ( 882408.3,6543019.6)

from pyproj import Proj, transform

inProj = Proj(init='epsg:2154')
outProj = Proj(init='epsg:4326')
x1,y1 = 882408.3,6543019.6
x2,y2 = transform(inProj,outProj,x1,y1)
print(x2,y2)

returns here the longitude and latitude:

5.355651287573366 45.96240165432614

Note: one can find the epsg references in the following site: spatialreference. For example 2154 for lambert 93 and 4326 for the World Geodetic System.

Note: pyproj package is available with the basemap module. Installation with anaconda distritubution:

conda install -c anaconda basemap

References