OSDN Git Service

Heightへの対応,緯度・経度が反転していた不具合の修正
[yubeshi/yubeshi.git] / Yubeshi / Ubx / NavPosLlh.cs
index e6f5a7a..96af3fa 100755 (executable)
@@ -38,16 +38,21 @@ namespace Yubeshi.Ubx
             {\r
                 Degree lon = BitConverter.ToInt32(Raw, 6 + 4) * 1e-7;\r
                 Degree lat = BitConverter.ToInt32(Raw, 6 + 8) * 1e-7;\r
-                double h = BitConverter.ToUInt32(Raw, 6 + 12);\r
-                return new GeodeticCoordinate(lon, lat, h);\r
+                Height h = new Height(\r
+                                    BitConverter.ToUInt32(Raw, 6 + 12) * 1e-3, \r
+                                    Height.Base.Ellipsoid);\r
+                return new GeodeticCoordinate(lat, lon, h);\r
             }\r
         }\r
 \r
-        public double MslHeight\r
+        public Height MslHeight\r
         {\r
             get\r
             {\r
-                return BitConverter.ToUInt32(Raw, 6 + 16);\r
+                Height h = new Height(\r
+                                    BitConverter.ToUInt32(Raw, 6 + 16) * 1e-3,\r
+                                    Height.Base.MeanSeaLevel);\r
+                return h;\r
             }\r
         }\r
 \r