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


C# GeoCoord.distanceFrom方法代码示例

本文整理汇总了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;
        }
开发者ID:slgrobotics,项目名称:QuakeMap,代码行数:32,代码来源:TileSet.cs

示例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;
        }
开发者ID:slgrobotics,项目名称:QuakeMap,代码行数:23,代码来源:LayerWaypoints.cs

示例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();
            }
        }
开发者ID:slgrobotics,项目名称:QuakeMap,代码行数:60,代码来源:CameraManager.cs


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