3

I am trying to follow the solution posted at Converting projected coordinates to lat/lon using Python to convert NZTM coordinates into WGS84.

I wrote following script to covert NZTM to WGS84:

from pyproj import Proj, transform

inProj = Proj(init='epsg:') outProj = Proj(init='epsg:4326') x1,y1 = 1400677.021,4914233.543 x2,y2 = transform(inProj,outProj,x1,y1) print x2,y2

I am not sure what would be the epsg number for NZTM. I tried to find it online but could not make it.

What is the EPSG number for NZTM?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
user2293224
  • 249
  • 1
  • 6

3 Answers3

3

EPSG is 2193

Code should be as follow:

from pyproj import Proj, transform

inProj = Proj(init='epsg:2193') outProj = Proj(init='epsg:4326') x1,y1 = 1400677.021,4914233.543 x2,y2 = transform(inProj,outProj,x1,y1) print x2,y2

Reference:
https://spatialreference.org/ref/epsg/2193/

Shiko
  • 2,883
  • 13
  • 22
3

EPSG is 2193.

I would use a small function as follow:

from pyproj import Proj, transform
from pyproj import Transformer

TRAN_2193_TO_4326 = Transformer.from_crs("EPSG:2193", "EPSG:4326")

def mytransform(lat, lon): return TRAN_2193_TO_4326.transform(lat, lon)

latitude = mytransform(1400677.021, 4914233.543)[0] longitude = mytransform(1400677.021, 4914233.543)[1]

Davide Raro
  • 116
  • 8
1

https://epsg.io/2193, i.e. 2193

You can search on epsg.io

alphabetasoup
  • 8,718
  • 4
  • 38
  • 78