예제 #1
0
        /// <summary>
        ///     Returns the maximum speed.
        /// </summary>
        /// <returns></returns>
        public KilometerPerHour MaxSpeed(TagsCollection tags)
        {
            // THESE ARE THE MAX SPEEDS FOR BELGIUM.
            // TODO: Find a way to make this all configurable.
            KilometerPerHour speed = 5;

            // get max-speed tag if any.
            var maxSpeedValue = tags.GetNumericValue("maxspeed");
            if (maxSpeedValue.HasValue)
            {
                return maxSpeedValue.Value;
            }

            string highwayType;
            if (TryGetHighwayType(tags, out highwayType))
            {
                speed = MaxSpeed(highwayType);
            }

            return speed;
        }