예제 #1
0
파일: Bicycle.cs 프로젝트: ikyaqoob/routing
        /// <summary>
        /// Returns true if the vehicle is allowed on the way represented by these tags
        /// </summary>
        protected override bool IsVehicleAllowed(IAttributeCollection tags, string highwayType)
        {
            if (!tags.InterpretAccessValues(VehicleTypes, "access"))
            {
                return(false);
            }

            // do the designated tags.
            var bicycle = string.Empty;

            if (tags.TryGetValue("bicycle", out bicycle))
            {
                if (bicycle == "designated")
                {
                    return(true); // designated bicycle
                }
                if (bicycle == "yes")
                {
                    return(true); // yes for bicycle
                }
                if (bicycle == "no")
                {
                    return(false); //  no for bicycle
                }
            }
            if (highwayType == "steps")
            {
                if (tags.Contains("ramp", "yes"))
                {
                    return(true);
                }
                return(false);
            }
            return(AccessibleTags.ContainsKey(highwayType));
        }
예제 #2
0
        /// <summary>
        /// Returns true if the vehicle is allowed on the way represented by these tags
        /// </summary>
        protected override bool IsVehicleAllowed(IAttributeCollection tags, string highwayType)
        {
            if (!tags.InterpretAccessValues(VehicleTypes, "access"))
            {
                return(false);
            }

            var foot = string.Empty;

            if (tags.TryGetValue("foot", out foot))
            {
                if (foot == "designated")
                {
                    return(true); // designated foot
                }
                if (foot == "yes")
                {
                    return(true); // yes for foot
                }
                if (foot == "no")
                {
                    return(false); // no for foot
                }
            }
            return(AccessibleTags.ContainsKey(highwayType));
        }
예제 #3
0
 /// <summary>
 /// Returns true if the vehicle is allowed on the way represented by these tags
 /// </summary>
 protected override bool IsVehicleAllowed(IAttributeCollection tags, string highwayType)
 {
     if (!tags.InterpretAccessValues(VehicleTypes, "access"))
     {
         return(false);
     }
     return(AccessibleTags.ContainsKey(highwayType));
 }