当前位置: 首页>>代码示例>>C#>>正文


C# TagsCollectionBase类代码示例

本文整理汇总了C#中TagsCollectionBase的典型用法代码示例。如果您正苦于以下问题:C# TagsCollectionBase类的具体用法?C# TagsCollectionBase怎么用?C# TagsCollectionBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TagsCollectionBase类属于命名空间,在下文中一共展示了TagsCollectionBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsVehicleAllowed

 /// <summary>
 /// Returns true if the vehicle is allowed on the way represented by these tags
 /// </summary>
 /// <param name="tags"></param>
 /// <param name="highwayType"></param>
 /// <returns></returns>
 protected override bool IsVehicleAllowed(TagsCollectionBase tags, string highwayType)
 {
     // do the designated tags.
     if (tags.ContainsKey("bicycle"))
     {
         if (tags["bicycle"] == "designated")
         {
             return true; // designated bicycle
         }
         if (tags["bicycle"] == "yes")
         {
             return true; // yes for bicycle
         }
         if (tags["bicycle"] == "no")
         {
             return false; //  no for bicycle
         }
     }
     if (tags.ContainsKey("foot"))
     {
         if (tags["foot"] == "designated")
         {
             return false; // designated foot
         }
     }
     return AccessibleTags.ContainsKey(highwayType);
 }
开发者ID:vcotlearov,项目名称:OsmSharp,代码行数:33,代码来源:Vehicle.cs

示例2: CompareTags

 /// <summary>
 /// Compares two tags collections.
 /// </summary>
 public static void CompareTags(TagsCollectionBase expected, TagsCollectionBase actual)
 {
     if (expected == null)
     {
         Assert.IsNull(actual);
     }
     else
     {
         if (expected.Count == 0)
         {
             Assert.IsTrue(actual == null || actual.Count == 0);
         }
         else
         {
             Assert.IsNotNull(actual);
             Assert.AreEqual(expected.Count, actual.Count);
             foreach (Tag tag in expected)
             {
                 Assert.IsTrue(actual.ContainsKeyValue(tag.Key, tag.Value));
             }
             foreach (Tag tag in actual)
             {
                 Assert.IsTrue(expected.ContainsKeyValue(tag.Key, tag.Value));
             }
         }
     }
 }
开发者ID:OsmSharp,项目名称:sqlserver-dataprovider,代码行数:30,代码来源:ComparisonHelpers.cs

示例3: Evaluate

        public override TagsCollectionBase Evaluate(TagsCollectionBase tags, OsmGeoType type)
        {
            var a_result = _a.Evaluate(tags, type);
            var b_result = _b.Evaluate(tags, type);

            return a_result.Union(b_result);
        }
开发者ID:cmberryau,项目名称:core,代码行数:7,代码来源:TagFilterAdditive.cs

示例4: Create

 /// <summary>
 /// Creates a new way.
 /// </summary>
 /// <param name="id"></param>
 /// <param name="nodes"></param>
 /// <param name="tags"></param>
 /// <returns></returns>
 public static Way Create(long id, TagsCollectionBase tags, params long[] nodes)
 {
     Way way = new Way();
     way.Id = id;
     way.Nodes = new List<long>(nodes);
     way.Tags = tags;
     return way;
 }
开发者ID:UnifyKit,项目名称:OsmSharp,代码行数:15,代码来源:Way.cs

示例5: GetLabelFor

 /// <summary>
 /// Returns a label for different categories of highways.
 /// </summary>
 /// <param name="tags"></param>
 /// <returns></returns>
 public RoutingLabel GetLabelFor(TagsCollectionBase tags)
 {
     if (_edge_intepreter.IsOnlyLocalAccessible(tags))
     {
         return new RoutingLabel('L', "OnlyLocalAccessible"); // local
     }
     return new RoutingLabel('R', "GeneralAccessible"); // regular.
 }
开发者ID:cmberryau,项目名称:routing,代码行数:13,代码来源:DefaultHighwayConstraints.cs

示例6: IsRoutable

 /// <summary>
 ///     Returns true if the edge with the given tags is routable.
 /// </summary>
 /// <param name="tags"></param>
 /// <returns></returns>
 public bool IsRoutable(TagsCollectionBase tags)
 {
     if (tags != null && tags.Count > 0)
     {
         return tags.ContainsKey("highway");
     }
     return false;
 }
开发者ID:cmberryau,项目名称:routing,代码行数:13,代码来源:EdgeInterpreter.cs

示例7: Create

 /// <summary>
 /// Creates a new relation.
 /// </summary>
 /// <param name="id"></param>
 /// <param name="tags"></param>
 /// <param name="members"></param>
 /// <returns></returns>
 public static Relation Create(long id, TagsCollectionBase tags, params RelationMember[] members)
 {
     Relation relation = new Relation();
     relation.Id = id;
     relation.Members = new List<RelationMember>(members);
     relation.Tags = tags;
     return relation;
 }
开发者ID:UnifyKit,项目名称:OsmSharp,代码行数:15,代码来源:Relation.cs

示例8: SerializeWithSize

        /// <summary>
        /// Serializes a tags collection to a byte array and addes the size in the first 4 bytes.
        /// </summary>
        /// <param name="collection"></param>
        /// <param name="stream"></param>
        /// <returns></returns>
        public void SerializeWithSize(TagsCollectionBase collection, Stream stream)
        {
            RuntimeTypeModel typeModel = TypeModel.Create();
            typeModel.Add(typeof(Tag), true);

            var tagsList = new List<Tag>(collection);
            typeModel.SerializeWithSize(stream, tagsList);
        }
开发者ID:UnifyKit,项目名称:OsmSharp,代码行数:14,代码来源:TagsCollectionSerializer.cs

示例9: Evaluate

        public override TagsCollectionBase Evaluate(TagsCollectionBase tags, OsmGeoType type)
        {
            if (tags == null)
            {
                throw new ArgumentNullException("tags");
            }

            return tags;
        }
开发者ID:cmberryau,项目名称:core,代码行数:9,代码来源:TagFilterAny.cs

示例10: GetName

 /// <summary>
 ///     Returns the name of a given way.
 /// </summary>
 /// <param name="tags"></param>
 /// <returns></returns>
 public string GetName(TagsCollectionBase tags)
 {
     var name = string.Empty;
     if (tags.ContainsKey("name"))
     {
         name = tags["name"];
     }
     return name;
 }
开发者ID:OpenMaps,项目名称:OsmSharp,代码行数:14,代码来源:EdgeInterpreter.cs

示例11: ConvertTags

 private IAttributesTable ConvertTags(TagsCollectionBase tags, long id)
 {
     var properties = tags.ToStringObjectDictionary();
     properties.Add("osm_id", id);
     var table = new AttributesTable();
     foreach (var key in properties.Keys)
     {
         table.AddAttribute(key, properties[key]);
     }
     return table;
 }
开发者ID:IsraelHikingMap,项目名称:Site,代码行数:11,代码来源:OsmGeoJsonConverter.cs

示例12: IsVehicleAllowed

 /// <summary>
 /// Returns true if the vehicle is allowed on the way represented by these tags
 /// </summary>
 /// <param name="tags"></param>
 /// <param name="highwayType"></param>
 /// <returns></returns>
 protected override bool IsVehicleAllowed(TagsCollectionBase tags, string highwayType)
 {
     if (tags.ContainsKey("motor_vehicle"))
     {
         if (tags["motor_vehicle"] == "no")
         {
             return false;
         }
     }
     return AccessibleTags.ContainsKey(highwayType);
 }
开发者ID:cmberryau,项目名称:routing,代码行数:17,代码来源:MotorVehicle.cs

示例13: GenerateDirectTurn

 /// <summary>
 /// Generates an instruction for a direct turn.
 /// </summary>
 /// <param name="countBefore"></param>
 /// <param name="street"></param>
 /// <param name="direction"></param>
 /// <param name="pois"></param>
 /// <returns></returns>
 protected override string GenerateDirectTurn(int countBefore, TagsCollectionBase street, RelativeDirection direction, List<PointPoi> pois)
 {
     countBefore++;
     if (countBefore == 1)
     {
         return string.Format("Neem de 1ste afslag {0}, de {1} op.", TurnDirection(direction), this.GetName("nl", street));
     }
     else
     {
         return string.Format("Neem de {0}de afslag {1}, de {2} op.", countBefore, TurnDirection(direction), this.GetName("nl", street));
     }
 }
开发者ID:OpenMaps,项目名称:OsmSharp,代码行数:20,代码来源:DutchLanguageGenerator.cs

示例14: GetNamesInAllLanguages

 /// <summary>
 ///     Returns all the names in all languages and alternatives.
 /// </summary>
 /// <param name="tags"></param>
 /// <returns></returns>
 public Dictionary<string, string> GetNamesInAllLanguages(TagsCollectionBase tags)
 {
     var names = new Dictionary<string, string>();
     //if (tags != null)
     //{
     //    foreach (var pair in tags)
     //    {
     //        var m = Regex.Match(pair.Key, "name:[a-zA-Z]");
     //        if (m.Success)
     //        {
     //            //throw new NotImplementedException();
     //        }
     //    }
     //}
     return names;
 }
开发者ID:OpenMaps,项目名称:OsmSharp,代码行数:21,代码来源:EdgeInterpreter.cs

示例15: Evaluate

        public override TagsCollectionBase Evaluate(TagsCollectionBase tags, OsmGeoType type)
        {
            if (tags == null)
            {
                throw new ArgumentNullException("tags");
            }

            var result = tags;

            if (type == _type)
            {
                result = TagsCollectionBase.Empty;
            }

            return result;
        }
开发者ID:cmberryau,项目名称:core,代码行数:16,代码来源:TagFilterNone.cs


注:本文中的TagsCollectionBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。