From 8ace3a12bafaf3e1a64f12307609dd8d243a26fe Mon Sep 17 00:00:00 2001
From: jmt <jmt>
Date: Mon, 26 Oct 2009 20:23:33 +0000
Subject: [PATCH] Better idents for waypoints defined by lon/lat.

---
 src/Autopilot/route_mgr.cxx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/Autopilot/route_mgr.cxx b/src/Autopilot/route_mgr.cxx
index 11cf31d26..b5ef62d72 100644
--- a/src/Autopilot/route_mgr.cxx
+++ b/src/Autopilot/route_mgr.cxx
@@ -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;