X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=src%2Ftim%2Fprune%2Ffunction%2Fsrtm%2FSrtmTile.java;fp=src%2Ftim%2Fprune%2Ffunction%2Fsrtm%2FSrtmTile.java;h=b90be8cde2b17e463bbd0d61224caedaa36d0f92;hb=5830ebbe09c757c04fba1dfedb9badeebb147c32;hp=7bc1d386419732c8d7ab9b048bcf06407d06a36b;hpb=3e9366f87bf4166017149c8bdcd32cf34bef6407;p=GpsPrune.git diff --git a/src/tim/prune/function/srtm/SrtmTile.java b/src/tim/prune/function/srtm/SrtmTile.java index 7bc1d38..b90be8c 100644 --- a/src/tim/prune/function/srtm/SrtmTile.java +++ b/src/tim/prune/function/srtm/SrtmTile.java @@ -41,9 +41,20 @@ public class SrtmTile * @param inOther other tile object * @return true if both represent same tile */ - public boolean equals(SrtmTile inOther) + public boolean equals(Object inOther) { - return (_latitude == inOther._latitude) && (_longitude == inOther._longitude); + if (! (inOther instanceof SrtmTile)) + { + return false; + } + SrtmTile otherTile = (SrtmTile) inOther; + return (_latitude == otherTile._latitude) && + (_longitude == otherTile._longitude); + } + + public int hashCode() + { + return 360 * _latitude + _longitude; } /** @return latitude as int */ @@ -72,8 +83,11 @@ public class SrtmTile public SrtmSource findBestCachedSource() { - SrtmSource[] sources = {new SrtmGl1Source(), - new Srtm3Source() }; + SrtmSource[] sources = { + new SrtmGl1Source(), + new SrtmViewfinderSource(), + new Srtm3Source(), + }; for (int i = 0; i < sources.length; i++) { if (sources[i].isCached(this))