1

Am trying to use python pyproj to do the above conversion (convert/transform from Hong Kong GRID to Hong Kong UTM), but am getting different values from the expected result.

My expected conversion result is: "North 836148, East 822745" to "North 828672.7449, East 12488562.2742". See my codes below for both zones (N and S):-

# https://epsg.io/102141

inProj = Proj(init='epsg:2326') # PCS: Hong_Kong_1980_Grid or EPSG:102140
outProj = Proj("+proj=utm +zone=49 +ellps=intl +units=m +no_defs") # PCS: Hong_Kong_1980_UTM_Zone_49N or EPSG:102141
# outPro = Proj(init='epsg:102141') # This returns RuntimeError

# Expected result: 828672.7449, 12488562.2742

x1, y1 = 822745, 836148
# x1, y1 = 836148, 822745


x2, y2 = transform(inProj, outProj, x1, y1)
print (x2, y2)

Or

# https://epsg.io/32749

inProj = Proj(init='epsg:2326') # PCS: Hong_Kong_1980_Grid or epsg:102140
# outProj = Proj("+proj=utm +zone=49 +south +datum=WGS84 +units=m +no_defs") # PCS: Hong_Kong_1980_UTM_Zone_49S or EPSG:32749
outProj = Proj(init='epsg:32749')

# Expected result: 828672.7449, 12488562.2742

x1, y1 = 822745, 836148
# x1, y1 = 836148, 822745


x2, y2 = transform(inProj, outProj, x1, y1)
print (x2, y2)

Could it be that my expected result is incorrect or I am missing something? I want to certisfy the expected output by going from: "Hong_Kong_1980_Grid_System" to "Hong_Kong_1980_UTM_Zone_49N / 49S"?

North   East    North1      East1
836148  822745  828672.7449 12488562.27
831905  822495  827480.7854 12473200.37
838208  816918  810095.1039 12481647.01
838127  816314  805922.5972 12482194.51
837452  820146  815300.3898 12484301.71
833764  816330  808333.7182 12478896.42
841476  830964  834944.8892 12495195.37

The result needs to match above table from Hong Kong 1980 grid to WGS84/UTM 49S

  • So what values are you getting? See if epsg:2326 has an associate transformation. Otherwise, you may need to give the full +proj string in order to add +wgs84=-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246 That's EPSG:1825. – mkennedy Aug 25 '17 at 22:23
  • I am getting "813428.0173294857 12487457.442199748" even after I have provided the full +proj string as: outProj = Proj("+proj=utm +zone=49 +south +datum=WGS84 +wgs84=-162.619,-276.959,-161.764,0.067753,-2.243649,-1.15827,-1.094246 +units=m +no_defs") # PCS: Hong_Kong_1980_UTM_Zone_49S or EPSG:32749 – Umar Yusuf Aug 26 '17 at 16:16
  • i have edited the question by adding more sample target coordinates... – Umar Yusuf Aug 26 '17 at 16:24
  • I don't think you can add the towgs string to the utm one, add it to a full hk80 grid definition. – mkennedy Aug 26 '17 at 17:15
  • I am now sensing that getting the correct definition of "+towgs84" parameters of Hong Kong 1980_UTM_Zone_49S would solve the issue? – Umar Yusuf Aug 27 '17 at 0:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.