How to convert from UTM to LatLng in python or Javascript

前端 未结 10 716
余生分开走
余生分开走 2020-11-30 23:00

I have a bunch of files with coordinates in UTM form. For each coordinate I have easting, northing and zone. I need to convert this to LatLng for use with Google Map API to

10条回答
  •  情深已故
    2020-11-30 23:32

    You could use Proj4js, as follows.

    Download Proj4JS from GitHub, using this link.

    The following code will convert from UTM to longitude latitude

    
    
      
    
      
    
    
    
    
    
    

    In this code, the UTM zone is 32, as should be obvious. The Easting is 539884, and the Northing is 4942158. The result is:

    [9.502832656648073, 44.631671014204365] 
    

    Which is to say 44.631671014204365N, 9.502832656648073E. Which I have verified is correct.

    If you need other projections, you can find their strings here.

提交回复
热议问题