コード例 #1
0
ファイル: NodeIndexTests.cs プロジェクト: schrod/routing
        public void NodeIndex_Regression1()
        {
            var index = new NodeIndex();

            index.AddId(4444197607);

            index.SortAndConvertIndex();
            var i = index.TryGetIndex(4444197607);

            Assert.AreEqual(0, i);
        }
コード例 #2
0
        public override bool OnBeforePull()
        {
            // execute the first pass.
            this.DoPull(true, false, false);

            // move to second pass.
            _firstPass = false;
            _nodeIndex.SortAndConvertIndex();
            this.Source.Reset();
            this.DoPull();

            return(false);
        }
コード例 #3
0
ファイル: NodeIndexTests.cs プロジェクト: schrod/routing
        public void TestNegativeIds()
        {
            var index = new NodeIndex();

            index.AddId(-128510752);
            index.SortAndConvertIndex();
            index.Set(-128510752, 11);

            index.TryGetValue(-128510752, out var latitude, out var longitude, out var isCore, out var vertex);
            Assert.AreEqual(float.MaxValue, latitude);
            Assert.AreEqual(float.MaxValue, longitude);
            Assert.AreEqual(false, isCore);
            Assert.AreEqual(11, vertex);
        }