Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve accuracy of toLatLon #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chris-cooper
Copy link

@chris-cooper chris-cooper commented Feb 9, 2021

The current implementation has inaccuracies. See:

The current implementation is giving discrepancies around the 7th decimal place in degrees:

image

The current implemenation has inaccuracies.  See:
- Turbo87/utm#36
- Turbo87/utm#49

repro:
```
var utm = require("utm");

var originalLatitude = -33.8688
var originalLongitude = 151.2093

const { easting, northing, zoneNum, zoneLetter} = utm.fromLatLon(originalLatitude,originalLongitude);

const { latitude, longitude } = utm.toLatLon(easting, northing, zoneNum, zoneLetter);

console.log(latitude, longitude)
console.log(`lat/lon delta: ${latitude-originalLatitude}:${longitude-originalLongitude}`)

{
  const { easting: easting2, northing: northing2, zoneNum: zoneNum2, zoneLetter: zoneLetter2} = utm.fromLatLon(latitude,longitude);
  console.log(`delta: ${easting - easting2}:${northing-northing2}`);
}
```
@jayarjo
Copy link

jayarjo commented Apr 21, 2021

@chris-cooper did this fix improve anything for you?

@jayarjo
Copy link

jayarjo commented Apr 21, 2021

Could someone merge this please? @TimothyGu

@heathhenley
Copy link

Looks like this change was already merged in Turbo87/utm#49 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants