TransWikia.com

Need a simple python program to convert EPSG/SRID 102002 (LCC) to WGS84

Geographic Information Systems Asked by parvij on February 20, 2021

I’m going to convert some coordinates from Canada LCC (EPSG/SRID 102002) into WGS84 (EPSG/SRID 4326).
I found a python package for this purpose which is pyproj. However, seems it doesn’t support 102002.

since I get this result:

Proj("+init=EPSG:102002")

CRSError: Invalid projection: +init=epsg:102002 +type=crs: (Internal Proj Error: proj_create: crs not found)

Transformer.from_crs(102002, 4326)

Invalid projection: epsg:102002: (Internal Proj Error: proj_create: crs not found)

I know there is a way to define a new coordinate with pyproj but it needs expertise in GIS which I don’t have. Building a Coordinate Reference System in pyproj

Would you please help me to create that coordinate reference system or give me a simple python code to convert those coordinate to each other?

I found this but it doesn’t work fine:

>>> import pyproj
>>> p = pyproj.Proj("+proj=lcc +lat_1=50 +lat_2=70 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs")
>>> p(7678236.84856942, 1280719.40571689,inverse=True)
-27.952924124739766 15.502198604012452

but I expect a pair of number near (45.4330538,-75.722731)

One Answer

You need to use ESRI:102002 for Canada LCC: https://epsg.io/102002

Transformer.from_crs("ESRI:102002", "EPSG:4326")

Answered by snowman2 on February 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP