Exemple #1
0
        public void BBoxExtendToCoverInflatesBBox()
        {
            PointGeo p1 = new PointGeo(12.1, 18.3, 100);
            PointGeo p2 = new PointGeo(-12.9, -34.3, 500);

            BBox target = new BBox();
            target.ExtendToCover(p1);
            target.ExtendToCover(p2);

            Assert.Equal(12.1, target.North);
            Assert.Equal(-12.9, target.South);
            Assert.Equal(18.3, target.East);
            Assert.Equal(-34.3, target.West);

            Assert.Equal(100, target.MinElevation);
            Assert.Equal(500, target.MaxElevation);
        }
        void CreateTrackCutout(GPXTrackSegment track)
        {
            _trackCutout.Clear();

            BBox trackBBox = new BBox();
            foreach (var point in track.Nodes) {
                trackBBox.ExtendToCover(point);
            }
            trackBBox.Inflate(0.0015, 0.0015);

            foreach (var road in _graph.ConnectionGeometries) {
                if (Topology.Intersects(road.BBox, trackBBox)) {
                    _trackCutout.Add(road);
                }
            }
        }