logo separator

[mkgmap-dev] [Patch v1] curve bytes

From Steve Ratcliffe steve at parabola.me.uk on Wed Feb 12 13:37:43 GMT 2014

On 12/02/14 10:46, Gerd Petermann wrote:
> @@ -80,22 +88,27 @@
>   		this.roadDef = roadDef;
>   		this.source = source;
>   		this.dest = dest;
> -		this.initialHeading = initialHeading;
> -		this.finalHeading = finalHeading;
> -		this.length = convertMeters(length);
> +		this.initialHeading = (float) initialBearing;
> +		this.finalHeading = (float) finalBearing;
> +		this.directHeading = (float) directBearing;
> +		this.length = convertMeters(length);
>   		this.curveEnabled = curveEnabled;
>   		this.pointsHash = pointsHash;
> +		int encodedDirectLength = convertMeters(source.getCoord().distance(dest.getCoord()));
> +		
> +		lengthRatio = (byte) ((int)Math.round(32.0 * encodedDirectLength / length) & 0x1f);

This (above) should use this.length, not length
		
> +		haveCurve = curveEnabled && lengthRatio > 0;
>   	}

That fix makes leaves me with just a small number of ratio errors.

..Steve


More information about the mkgmap-dev mailing list