0

i found another topic where i have found this code:

utm15_wgs84 = pp.Proj(init='epsg:3575')

df[['wgs_x', 'wgs_y']] = df.apply(lambda row:utm15_wgs84(row['Lat'],
    row['Long'], inverse=True), axis=1).apply(pd.Series)

my df (INPUT):

Lat, Long
415634,-0625511.4

in real those coordinates are : 41 56 34 N and 062 55 11.4 W I need convert them to decimal degree format

expecting output should be : using calculations:

41+56/60+34/3600 ,-( 62+55/60+11.4/3600 )

Lat, Long
41.9427777777778,-62.9198333333333

Using code above i am receiving

result:

Lat, Long
44.622697, 82.973245 

It's wrong ;/ i have tried to change init='epsg:4326' and init='epsg:3575', and still bad results. Whats will be the best way to convert coordinates like in INPUT to get expected result?

sygneto
  • 1,761
  • 1
  • 13
  • 26
  • Can you be a bit more explicit about what you are trying to do? What coordinate system and what format is your input, and what coordinate system and format is your desired output? – Ture Pålsson Jan 10 '19 at 09:57
  • You say they output you are getting is wrong, but you also need to say what you are expecting. Otherwise we can't tell if a proposed solution actually solves your problem. – BoarGules Jan 10 '19 at 10:14
  • please take a loot on edited post, thanks – sygneto Jan 10 '19 at 10:49

1 Answers1

0

You haven't told us what pp or df are, so technically, we have no idea what your code does.

However, assuming that pp is pyproj, I believe it can not do what you want from it (though I may be wrong). You will simply have to do the sexagesimal conversion yourself. Without knowing what the rest of your program looks like, it is hard to say exactly how, but my bet would be on reading the coordinates as text strings, cutting out the various parts with the usual text slicing operators, converting them to numbers and doing the d + m/60 + s/3600 calculations on those.

Ture Pålsson
  • 6,088
  • 2
  • 12
  • 15