Esempio n. 1
0
        /// <summary>
        /// Returns the maximum speed.
        /// </summary>
        /// <returns></returns>
        public KilometerPerHour MaxSpeedAllowed(TagsCollectionBase 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.
            if (tags.TryGetMaxSpeed(out speed))
            {
                return(speed);
            }

            string highwayType;

            if (TryGetHighwayType(tags, out highwayType))
            {
                speed = this.MaxSpeedAllowed(highwayType);
            }

            return(speed);
        }
Esempio n. 2
0
        /// <summary>
        /// Returns the maximum speed.
        /// </summary>
        /// <returns></returns>
        public virtual KilometerPerHour MaxSpeedAllowed(TagsCollectionBase 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.
            if(tags.TryGetMaxSpeed(out speed))
            {
                return speed;
            }

            string highwayType;
            if (TryGetHighwayType(tags, out highwayType))
            {
                speed = this.MaxSpeedAllowed(highwayType);
            }

            return speed;
        }