本文整理汇总了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;
}