Results 1 to 3 of 3

Thread: UTM coordinates to lat/long help

  1. #1
      shiznatix is offline
    Guild Applicant
    Join Date
    Sep 2013
    Posts
    2

    Default UTM coordinates to lat/long help

    Hello. First time poster / visitor but hopefully I will be able to get some help here as I am stumped.

    I ran across a piece of code has a collection of UTM POINTS that takes the point and places it on a map. Now, I have all this data but I need a way to get the latitude and longitude of each point. I have tried many thing but am unable to convert it exactly, always dancing around that area of the world but nowhere near as close as I need it to be.

    For example, I have the POINT 735622.1 6588896.1 using the International 1924 datum in zone 35V. I already know the lat/long for this point which is 59.37249,28.147 (I did this one manually but there are hundreds more and I don't want to try to do it manually for all of them). Now, when I put this POINT into any online converter such as Convert Between Geographic and UTM Coordinates I get a different lat/long, a hundred or so KM away from my target.

    I know there is something more going on in the background though as the code snippet is using more variables than any of the converters. The code snipped looks like this:
    Code:
    latitude = enToLat(x, y, eRadius, pRadius, e, n, f, phi, lam);
    and the variables for this are:
    Code:
    eRadius = 6378388;
    pRadius = 6356911.94612795;
    e = 200000;
    n = 300000;
    f = 0.99999;
    phi = 24.45;
    lam = 51.2166666666667;
    I am guessing that there is something extra that I am missing regarding the phi and lam variables but I don't know what they are supposed to be representing. The same goes for the variables e, n, f.

    If anyone could help me shed a bit of light on what these variables are and what calculations are being done I would be most appreciative.

  2. #2
      Redrobes is offline
    Software Dev/Rep Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    4,776
    Blog Entries
    4

    Default

    I think what you need to use is the GDAL package which has bindings for various languages. I would use Perl but I think most would use Python. Here is a link to some code which might be useful...

    How to convert from UTM to LatLng in python or Javascript - Stack Overflow

  3. #3
      shiznatix is offline
    Guild Applicant
    Join Date
    Sep 2013
    Posts
    2

    Default

    Thanks for the link. The python script there, with a few slight modifications, worked perfectly. Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •