当前位置: 首页>>代码示例>>C#>>正文


C# GeoCoord.almostAs方法代码示例

本文整理汇总了C#中LibGeo.GeoCoord.almostAs方法的典型用法代码示例。如果您正苦于以下问题:C# GeoCoord.almostAs方法的具体用法?C# GeoCoord.almostAs怎么用?C# GeoCoord.almostAs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LibGeo.GeoCoord的用法示例。


在下文中一共展示了GeoCoord.almostAs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: logTrack

        // real-time track logging:
        private bool logTrack(GpsRealTimeData  rtData)
        {
            bool ret = false;

            // only good fixes with non-null location reach here
            string source = "GPS-" + DateTime.Now;

            string trackName = "GPSLOG-" + Project.trackId;

            if(!trackCreated)
            {
                Project.trackId++;

                CreateInfo createInfo = new CreateInfo();

                createInfo.init("trk");
                createInfo.name	= trackName;
                createInfo.id = Project.trackId;
                createInfo.source = source;

                totalTrkpt = 0;

                WaypointsCache.insertWaypoint(createInfo);	// actually inserts a track
                trackCreated = true;
                WaypointsCache.isDirty = true;
            }

            // garmin sends data every second, even if it is same point. Ignore repetetions to save memory.

            double[] howfars = new Double[] { 0.0d, 1.0d, 10.0d, 20.0d, 50.0d, 100.0d };

            double howFarMeters = howfars[trackToleranceComboBox.SelectedIndex];
            GeoCoord loc = new GeoCoord(rtData.location.Lng, rtData.location.Lat, rtData.location.Elev);
            // tolerance 0.0001 degree = 10 meters
            if(trackToleranceComboBox.SelectedIndex == 0 || !loc.almostAs(lastTrackLoc, howFarMeters * 0.00001d))		// 0 means every incoming reading
            //if(rtData.location.Lat != lastLat || rtData.location.Lng != lastLng || rtData.location.Elev != lastElev)
            {
                CreateInfo createInfo = new CreateInfo();

                createInfo.init("trkpt");
                createInfo.id = Project.trackId;			// relate waypoint to track
                createInfo.dateTime = rtData.time;			// always zulu
                createInfo.lat = rtData.location.Lat;
                createInfo.lng = rtData.location.Lng;
                createInfo.elev = rtData.location.Elev;
                createInfo.source = source;
                //createInfo.name = "" + totalTrkpt;		// track point name

                lastLat = rtData.location.Lat;
                lastLng = rtData.location.Lng;
                lastElev = rtData.location.Elev;

                totalTrkpt++;
                ret = true;

                WaypointsCache.insertWaypoint(createInfo);
                lastTrackLoc = loc;
            }
            return ret;
        }
开发者ID:slgrobotics,项目名称:QuakeMap,代码行数:61,代码来源:DlgGpsManager.cs


注:本文中的LibGeo.GeoCoord.almostAs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。