Use center latitude for getLonLatToMeters calls

This commit is contained in:
Phyks (Lucas Verney) 2018-12-07 14:24:51 +01:00
parent 34f5258f5e
commit e0259e4cde

View file

@ -346,7 +346,7 @@ abstract class OsmPath implements OsmLinkHolder
if ( rc.startDirectionValid )
{
double dir = rc.startDirection.intValue() / CheapRulerSingleton.DEG_TO_RAD;
double[] lonlat2m = CheapRulerSingleton.getLonLatToMeterScales( lat1 );
double[] lonlat2m = CheapRulerSingleton.getLonLatToMeterScales( (lon0 + lat1) >> 1 );
lon0 = lon1 - (int) ( 1000. * Math.sin( dir ) / lonlat2m[0] );
lat0 = lat1 - (int) ( 1000. * Math.cos( dir ) / lonlat2m[1] );
}