user9555176
user9555176

Reputation: 21

proj4 lat/lon to UTM and back to lat/lon

I'm using proj4 to project lat/log coordinates to UTM. But I'm not able to project back from UTM to lat/log. For the following example I would expect the code to return the given lat/log [ 48.37966, 2.504635 ]. Instead it's returning a differnt lat/log [48.51134181677054, 2.46032747988605];

<script>
    var utm = '+proj=utm +ellps=GRS80 +datum=nad83 +units=m +no_defs +zone=31U';
    var latlon = '+proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees +no_defs';

    var a = proj4(
        latlon,
        utm,
        [ 48.37966, 2.504635 ]
    );

    var b = proj4(
        utm,
        latlon,
        a);
console.log( b );
</script>

Do I need to use a different projection string?

Upvotes: 1

Views: 2177

Answers (1)

user9555176
user9555176

Reputation: 21

A few hours later... it turns out to be an issue in older versions of proj4js. Just upgrade to the latest proj4js version and it should work better - at least that did the trick for me.

Upvotes: 1

Related Questions