Giter Site home page Giter Site logo

Comments (2)

chrisveness avatar chrisveness commented on August 29, 2024

Hmm. There are a couple of issues here.

The link you gave, epsg.io/transform#s_srs=23030&t_srs=4326&x=572120&y=6382750, specifies 'EPSG:4326 WGS 84' as the output coordinate system.

If you specify 'EPSG:4230 ED50' as the output coordinate system – e.g. epsg.io/transform#s_srs=23030&t_srs=4230&x=572120&y=6382750 – the latitude/longitude values match the ones you were seeing in the code above.

To get WGS84 latitude/longitude from the geodesy library, you might do as follows:

import Utm, { LatLon } from './utm.js';
const utm = new Utm(30, 'N', 572120, 6382750, LatLon.datums.ED50);
const latlonED50 = utm.toLatLon();
const latlonWGS84 = latlonED50.convertDatum(LatLon.datums.WGS84);
console.log('ED50 ', latlonED50.toString('d', 7));  // 57.5801190°N, 001.7939918°W
console.log('WGS84', latlonWGS84.toString('d', 7)); // 57.5794383°N, 001.7956491°W

This still leaves a difference between the geodesy library values and the epsg.io values of close to 3 metres. As epsg.io is closed-source(?), I can't check the cause of this.

However, in order to do this conversion, I had to change utm.js to import LatLonEllipsoidal from latlon-ellipsoidal-datum.js, rather than latlon-ellipsoidal.js. I will change this in the library.

from geodesy.

qwilka avatar qwilka commented on August 29, 2024

OK thanks. So part of the problem is that I omitted to convert the LatLon from ED50 to WGS84 in my geodesy code. Since you are going to update geodesy to facilitate the LatLon datum conversion, and since the discrepancy in the result between geodesy and epsg.io has been noted, I would propose to close this issue.

from geodesy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.