From 08f4e40192c78706d32db3ae3aac982fbb860382 Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Thu, 28 Apr 2011 07:44:22 +0000 Subject: [PATCH] geography : issue 4866 : geoperson animation : rounding problem. svn: r17308 --- src/plugins/view/geoperson.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/view/geoperson.py b/src/plugins/view/geoperson.py index b83d3be0b..a88cb5566 100644 --- a/src/plugins/view/geoperson.py +++ b/src/plugins/view/geoperson.py @@ -228,10 +228,10 @@ class GeoPerson(GeoGraphyView): return False self.osm.gps_add(startlat, startlon, heading) stepyear += 1 - difflat = ( startlat - endlat ) if startlat > endlat else \ - ( endlat - startlat ) - difflon = ( startlon - endlon ) if startlon > endlon else \ - ( endlon - startlon ) + difflat = round(( startlat - endlat ) if startlat > endlat else \ + ( endlat - startlat ), 8) + difflon = round(( startlon - endlon ) if startlon > endlon else \ + ( endlon - startlon ), 8) if ( difflat == 0.0 and difflon == 0.0 ): i += 1 if ( int(startyear) + stepyear ) > int(endmov) :