Implement a cache for the cosine computation in CheapRuler.
This commit is contained in:
parent
665b7096e8
commit
c78b56645c
5 changed files with 107 additions and 48 deletions
|
|
@ -6,7 +6,7 @@
|
|||
package btools.memrouter;
|
||||
|
||||
import btools.mapaccess.OsmPos;
|
||||
import btools.util.CheapRuler;
|
||||
import btools.util.CheapRulerSingleton;
|
||||
|
||||
public class OsmNodeP extends OsmLinkP implements Comparable<OsmNodeP>, OsmPos
|
||||
{
|
||||
|
|
@ -103,7 +103,8 @@ public class OsmNodeP extends OsmLinkP implements Comparable<OsmNodeP>, OsmPos
|
|||
@Override
|
||||
public int calcDistance( OsmPos p )
|
||||
{
|
||||
return (int)(CheapRuler.distance(ilon, ilat, p.getILon(), p.getILat()) + 1.0 );
|
||||
CheapRulerSingleton cr = CheapRulerSingleton.getInstance();
|
||||
return (int)(cr.distance(ilon, ilat, p.getILon(), p.getILat()) + 1.0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue