Пример #1
0
        public void NodeIndex_Regression1()
        {
            var index = new NodeIndex();

            index.AddId(4444197607);

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

            Assert.AreEqual(0, i);
        }
        public override void AddNode(Node node)
        {
            if (_firstPass)
            {
                return;
            }

            if (!node.Id.HasValue)
            {
                return;
            }
            if (!node.Longitude.HasValue || !node.Latitude.HasValue)
            {
                return;
            }

            // check if the node is a routing node and if yes, store it's coordinate.
            var index = _nodeIndex.TryGetIndex(node.Id.Value);

            if (index != long.MaxValue)
            { // node is a routing node, store it's coordinates.
                _nodeIndex.SetIndex(index, (float)node.Latitude.Value, (float)node.Longitude.Value);
            }
        }