本文整理汇总了C#中LibGeo.GeoCoord.distanceFrom方法的典型用法代码示例。如果您正苦于以下问题:C# GeoCoord.distanceFrom方法的具体用法?C# GeoCoord.distanceFrom怎么用?C# GeoCoord.distanceFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibGeo.GeoCoord
的用法示例。
在下文中一共展示了GeoCoord.distanceFrom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getCloseObjects
// returns number of LiveObject based objects added to the list:
public override int getCloseObjects(SortedList list, GeoCoord loc, double radiusMeters)
{
int count = 0;
try
{
for(int vv=0; vv < m_vCount ;vv++)
{
for(int hh=0; hh < m_hCount ;hh++)
{
Tile tile = m_tiles[vv, hh];
Features features = tile.features;
if(features != null && !features.IsEmpty)
{
foreach(LiveObject lo in features.List)
{
double dMeters = loc.distanceFrom(lo.Location).Meters;
if(dMeters <= radiusMeters)
{
list.Add(dMeters, lo);
count++;
}
}
}
}
}
}
catch {}
return count;
}
示例2: getCloseObjects
// returns number of LiveObject based objects added to the list:
public override int getCloseObjects(SortedList list, GeoCoord loc, double radiusMeters)
{
int count = 0;
// list of LiveObject by key=double (distance from loc)
try
{
// WaypointsDisplayed contains trackpoints, we don't want them in the list so far
foreach(Waypoint wpt in WaypointsCache.WaypointsAll)
{
double dMeters = loc.distanceFrom(wpt.Location).Meters;
if(dMeters <= radiusMeters)
{
list.Add(dMeters, wpt);
count++;
}
}
}
catch {}
return count;
}
示例3: pdaExportDragRectangle
public void pdaExportDragRectangle()
{
GeoCoord topLeft = toGeoLocation(new Point(dragRectangle.X, dragRectangle.Y));
GeoCoord bottomRight = toGeoLocation(new Point(dragRectangle.X + dragRectangle.Width, dragRectangle.Y + dragRectangle.Height));
// try to get the high-level map to reasonable extent:
GeoCoord coverageTopLeft = new GeoCoord(m_coverageTopLeft);
GeoCoord coverageBottomRight = new GeoCoord(m_coverageBottomRight);
// to paint red rectangle indicating high-level coverage:
double marginLat = (m_coverageTopLeft.Lat - m_coverageBottomRight.Lat) / 100.0d;
double marginLng = (m_coverageBottomRight.Lng - m_coverageTopLeft.Lng) / 140.0d;
Distance screenDiag = coverageTopLeft.distanceFrom(coverageBottomRight);
this.resetDrag(true);
Application.DoEvents();
Graphics graphics = PictureManager.This.Graphics;
if(screenDiag.Meters > 20000.0d)
{
// camera too far to preload all, get area around the well covered:
coverageTopLeft.Lat = Math.Min(m_coverageTopLeft.Lat - marginLat, (topLeft.Lat + bottomRight.Lat) / 2.0d + 0.1d);
coverageTopLeft.Lng = Math.Max(m_coverageTopLeft.Lng + marginLng, (topLeft.Lng + bottomRight.Lng) / 2.0d - 0.14d);
coverageBottomRight.Lat = Math.Max(m_coverageBottomRight.Lat + marginLat, (topLeft.Lat + bottomRight.Lat) / 2.0d - 0.1d);
coverageBottomRight.Lng = Math.Min(m_coverageBottomRight.Lng - marginLng, (topLeft.Lng + bottomRight.Lng) / 2.0d + 0.14d);
}
else
{
// just highlight the whole screen, reminding that the area will be saved:
coverageTopLeft.Lat = m_coverageTopLeft.Lat - marginLat;
coverageTopLeft.Lng = m_coverageTopLeft.Lng + marginLng;
coverageBottomRight.Lat = m_coverageBottomRight.Lat + marginLat;
coverageBottomRight.Lng = m_coverageBottomRight.Lng - marginLng;
}
this.PaintGeoRect(coverageTopLeft, coverageBottomRight, graphics, Pens.Red, "loading 16-64m");
this.PaintGeoRect(topLeft, bottomRight, graphics, Pens.Yellow, "loading 1-64m");
// the operations below will add to TerraserverCache.TileNamesCollection:
TileSetTerraLayout.downloadPdaThemesAtLevel(coverageTopLeft, coverageBottomRight, 14, true); // scales 16, 32, 64
// now get the well coverage:
TileSetTerraLayout.downloadPdaThemesAtLevel(topLeft, bottomRight, 10, true);
Application.DoEvents();
if(m_pdaMonitorThread == null)
{
m_pdaMonitorThread = new Thread( new ThreadStart(monitorPdaExportProgress));
// see Entry.cs for how the current culture is set:
m_pdaMonitorThread.CurrentCulture = Thread.CurrentThread.CurrentCulture; //new CultureInfo("en-US", false);
m_pdaMonitorThread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture; //new CultureInfo("en-US", false);
m_pdaMonitorThread.IsBackground = true; // terminate with the main process
m_pdaMonitorThread.Name = "Monitoring PDA download";
m_pdaMonitorThread.Start();
}
}