-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fixed LLtoUTMUPSObject northing values in southern hemisphere. #26
Conversation
…isInUPSSpace library convenience method.
…o add unit test cases to isInUPSSpace test.
Hero successful 🍾 |
USNG4J equivalent PR: codice/usng4j#15 |
} else { | ||
let utmcoords = [0, 0, 0, 'N'] | ||
this.LLtoUTMwithNS(lat, lon, utmcoords) | ||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This confused me a bit at first because I didn't realize utmcoords would be mutated by LLtoUTMwithNS.
Probably my own preference here, but I would prefer to avoid the mutation and have LLtoUTMwithNS return something instead.
That's outside this change though.
@@ -638,15 +638,27 @@ extend(Converter.prototype, { | |||
} | |||
}, | |||
|
|||
isInUPSSpace(lat) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a typescript file we could define the type for this function to catch possible issues at compile time.
Northing values in the southern hemisphere are now correctly converted from Lat Lon to UTM. The unit tests have been updated to check northing values. In addition a isInUPSSpace convenience method is added with unit tests to help library users verify if a Lat Lon coordinate can be converted to UPS or not.