X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fdata%2FCoordinate.java;h=556bd892797cac3834f89d316dadbb6a726d0fab;hb=140e9d165f85c3d4f0435a311e091209313faa2a;hp=190c66573b13e2c251a434407bc02315d34c0984;hpb=1ee49ae3c8ef3aa2e63eadd458531e5f8bd4f92c;p=GpsPrune.git diff --git a/tim/prune/data/Coordinate.java b/tim/prune/data/Coordinate.java index 190c665..556bd89 100644 --- a/tim/prune/data/Coordinate.java +++ b/tim/prune/data/Coordinate.java @@ -117,6 +117,7 @@ public abstract class Coordinate } // parse fields according to number found _degrees = (int) fields[0]; + _asDouble = _degrees; _originalFormat = hasCardinal?FORMAT_DEG:FORMAT_DEG_WITHOUT_CARDINAL; _fracDenom = 10; if (numFields == 2) @@ -262,11 +263,7 @@ public abstract class Coordinate */ public boolean equals(Coordinate inOther) { - return (inOther != null && _cardinal == inOther._cardinal - && _degrees == inOther._degrees - && _minutes == inOther._minutes - && _seconds == inOther._seconds - && _fracs == inOther._fracs); + return (_asDouble == inOther._asDouble); } @@ -303,8 +300,12 @@ public abstract class Coordinate } case FORMAT_DEG_WHOLE_MIN: { - answer = "" + PRINTABLE_CARDINALS[_cardinal] + threeDigitString(_degrees) + "\u00B0" - + (int) Math.floor(_minutes + _seconds / 60.0 + _fracs / 60.0 / _fracDenom + 0.5) + "'"; + int deg = _degrees; + int min = (int) Math.floor(_minutes + _seconds / 60.0 + _fracs / 60.0 / _fracDenom + 0.5); + if (min == 60) { + min = 0; deg++; + } + answer = "" + PRINTABLE_CARDINALS[_cardinal] + threeDigitString(deg) + "\u00B0" + min + "'"; break; } case FORMAT_DEG: