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

MGRS conversion fixes #68

Closed
wants to merge 1 commit into from
Closed

MGRS conversion fixes #68

wants to merge 1 commit into from

Conversation

wcmatthysen
Copy link
Member

@wcmatthysen wcmatthysen commented Aug 7, 2019

Description of the Change

Pulled in changes from upstream PR #157 of @gbburkhardt.

Why Should This Be In Core?

Bugfixes to MGRS coordinate conversion is critical to have in core.

Benefits

More stable MGRS coordinate conversion logic.

Potential Drawbacks

None

Applicable Issues

Issue #67

Fix index out of bounds error due to a typo in convertMGRSToUPS;
Fix handling of extreme southern latitude (zone 0) conversions
following Geotrans 3.7 for guidance: should give
Lat: -89.345400 deg, Lon: -48.930600 deg ==> MGRS: AZN 45208 47747
@wcmatthysen wcmatthysen added the bug Something isn't working label Aug 7, 2019
@wcmatthysen wcmatthysen modified the milestone: WWJ-CE 2.2.0 Aug 7, 2019
j = i;
while (i < MGRSString.length() && Character.isDigit(MGRSString.charAt(i)))
while (i < MGRSString.length() && Character.isDigit(' '))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gbburkhardt, I'm not sure this change is correct. The Character.isDigit(' ') call will always return false.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can drop this while loop from the look of it.

*
* @return the error code.
*/
private long checkZone(String MGRSString)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gbburkhardt, is it ok for us to drop this checkZone() method? I see that it was used in the convertMGRSToGeodetic() method for error-checking. I suppose the breakMGRSString() method provides similar error-checking.

@ComBatVision
Copy link
Member

ComBatVision commented Aug 11, 2019

Could you please make the same changes in my Android branch just to save time? You are in context of issue now.
WorldWindEarth/WorldWindAndroid#16

@gbburkhardt
Copy link
Member

gbburkhardt commented Aug 11, 2019 via email

@gbburkhardt
Copy link
Member

gbburkhardt commented Aug 11, 2019 via email

@wcmatthysen
Copy link
Member Author

wcmatthysen commented Aug 11, 2019

@gbburkhardt, nope... there was no compiler warning. I was lucky to spot it in the diffs of the commit.

@gbburkhardt
Copy link
Member

You caught a bug. I checked what we have in production, and created another pull request . I added a unit test. Thanks.

@wcmatthysen wcmatthysen removed the bug Something isn't working label Aug 14, 2019
@wcmatthysen wcmatthysen removed this from the WWJ-CE 2.2.0 milestone Aug 14, 2019
@wcmatthysen wcmatthysen added the duplicate This issue or pull request already exists label Aug 14, 2019
@wcmatthysen
Copy link
Member Author

I'm closing this as a duplicate of PR #72.

@wcmatthysen wcmatthysen deleted the MGRS-fixes branch August 14, 2019 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants