]> git.mxchange.org Git - flightgear.git/commitdiff
Better idents for waypoints defined by lon/lat.
authorjmt <jmt>
Mon, 26 Oct 2009 20:23:33 +0000 (20:23 +0000)
committerTim Moore <timoore@redhat.com>
Mon, 26 Oct 2009 21:12:20 +0000 (22:12 +0100)
src/Autopilot/route_mgr.cxx

index 11cf31d26d08ef938c3f0eb15cd22c0ff481df17..b5ef62d729974157f9d2c25899f24160a27fa689 100644 (file)
@@ -347,7 +347,11 @@ SGWayPoint* FGRouteMgr::make_waypoint(const string& tgt ) {
     if ( pos != string::npos ) {
         double lon = atof( target.substr(0, pos).c_str());
         double lat = atof( target.c_str() + pos + 1);
-        return new SGWayPoint( lon, lat, alt, SGWayPoint::WGS84, target );
+        char buf[32];
+        char ew = (lon < 0.0) ? 'W' : 'E';
+        char ns = (lat < 0.0) ? 'S' : 'N';
+        snprintf(buf, 32, "%c%03d%c%03d", ew, (int) fabs(lon), ns, (int)fabs(lat));
+        return new SGWayPoint( lon, lat, alt, SGWayPoint::WGS84, buf);
     }    
 
     SGGeod basePosition;