I am trying to convert X,Y system to latitude and longitude, and it seems that many people recommend pyproj
In their sample code, they use p1 = Proj(init='epsg:26915')
and p2 = Proj(init='epsg:26715')
But that's for UTM Zone15 Here is my sample x = 492893.53, y= 5458938.38 and my sample code for UTM Zone10N:
p1 = Proj(init='epsg:26910')
p2 = Proj(init='epsg:26710')
x,y = 492893.53, 5458938.38
x2,y2 = transform(p1, p2, x, y)
The output x2, y2 are not the right latitude and longitude
I tried to check epsg value for UTM Zone 10N, there are 3 versions online: version 1, version 2, version 3 I tried all of them, none of them work.
What does p1, p2 really mean and how can I find the values of p1, p2 for any UTM Zone?
If you are converting to lat-long then you need the projection for your lat-long coordinate system. In most cases this is WGS84 Lat-long as used by GPS, which is EPSG code 4326.
import pyproj
ll = pyproj.Proj(init="epsg:4326")
then you need a projection from your data points. In this case, you say its UTM10, but you don't say which of the variants, but there's no way of telling from the coordinates. First lets's try the WGS84 version:
>>> utm10 = pyproj.Proj(init="epsg:32610")
>>> pyproj.transform(utm10, ll, 492893.53, 5458938.38)
(-123.0977143330712, 49.28315708900033)
This looks like a possible lat-long (actually (-123, 49) is long-lat) for the valid region of UTM10. So I'm not sure what "none of them work" means in your question.
The other two projection codes yield close or identical results. Which one you use cannot be determined from the numbers alone - you have to ask whoever supplied the numbers what projection they are in.
You cannot even determine which UTM zone the points are in given your x and y coordinates. They could be any zone on the planet, since the x and y numbers are duplicate for each zone in each zone's longitude band.