
I don't know what's happening with the results of the bearing calculations. So as long as the results differ I don't want to commit that without a solid explanation that this is ok. WanMil
Hi WanMil,
the calculation in bearingTo() involves a lot of rounding errors because of the trig. functions. I verified that no value differed more than 0.5, which is good enough for us since we only use the integer value. See also http://www.movable-type.co.uk/scripts/latlong.html It says: "For final bearing, simply take the initial bearing from the end point to the start point and reverse it (using θ = (θ+180) % 360)."
That's what I tried to implement.
Gerd
WanMil wrote
Hi Gerd,
I have checked your patch by comparing old bearing to results with new results. I got lots of differences as you can see by trying attached patch.
Can you please carefully check why there is a difference and which version is 'better'?
WanMil
Hi,
in class RoadNetwork we calculate both p1.bearingTo(p2) and the reverse p2.bearingTo(p1). I think the reverse value should be calculated from the initial value.
See attached patch.
Gerd
http://gis.19327.n5.nabble.com/file/n5533880/bearingTo.patch bearingTo.patch
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-Reduce-bearingTo-calculations-tp5533880... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-Reduce-bearingTo-calculations-tp5533880... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev