本文整理汇总了C#中TagsCollectionBase.IsTrue方法的典型用法代码示例。如果您正苦于以下问题:C# TagsCollectionBase.IsTrue方法的具体用法?C# TagsCollectionBase.IsTrue怎么用?C# TagsCollectionBase.IsTrue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TagsCollectionBase
的用法示例。
在下文中一共展示了TagsCollectionBase.IsTrue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsPotentiallyArea
/// <summary>
/// Returns true if the given tags collection contains tags that could represents an area.
/// </summary>
/// <param name="tags"></param>
/// <returns></returns>
public override bool IsPotentiallyArea(TagsCollectionBase tags)
{
if (tags == null || tags.Count == 0) { return false; } // no tags, assume no area.
bool isArea = false;
if ((tags.ContainsKey("building") && !tags.IsFalse("building")) ||
(tags.ContainsKey("landuse") && !tags.IsFalse("landuse")) ||
(tags.ContainsKey("amenity") && !tags.IsFalse("amenity")) ||
(tags.ContainsKey("harbour") && !tags.IsFalse("harbour")) ||
(tags.ContainsKey("historic") && !tags.IsFalse("historic")) ||
(tags.ContainsKey("leisure") && !tags.IsFalse("leisure")) ||
(tags.ContainsKey("man_made") && !tags.IsFalse("man_made")) ||
(tags.ContainsKey("military") && !tags.IsFalse("military")) ||
(tags.ContainsKey("natural") && !tags.IsFalse("natural")) ||
(tags.ContainsKey("office") && !tags.IsFalse("office")) ||
(tags.ContainsKey("place") && !tags.IsFalse("place")) ||
(tags.ContainsKey("power") && !tags.IsFalse("power")) ||
(tags.ContainsKey("public_transport") && !tags.IsFalse("public_transport")) ||
(tags.ContainsKey("shop") && !tags.IsFalse("shop")) ||
(tags.ContainsKey("sport") && !tags.IsFalse("sport")) ||
(tags.ContainsKey("tourism") && !tags.IsFalse("tourism")) ||
(tags.ContainsKey("waterway") && !tags.IsFalse("waterway")) ||
(tags.ContainsKey("wetland") && !tags.IsFalse("wetland")) ||
(tags.ContainsKey("water") && !tags.IsFalse("water")) ||
(tags.ContainsKey("aeroway") && !tags.IsFalse("aeroway")))
{ // these tags usually indicate an area.
isArea = true;
}
string typeValue;
if (tags.TryGetValue("type", out typeValue))
{ // there is a type in this relation.
if (typeValue == "multipolygon")
{ // this relation is a multipolygon.
isArea = true;
}
else if (typeValue == "boundary")
{ // this relation is a boundary.
isArea = true;
}
}
if (tags.IsTrue("area"))
{ // explicitly indicated that this is an area.
isArea = true;
}
else if (tags.IsFalse("area"))
{ // explicitly indicated that this is not an area.
isArea = false;
}
return isArea;
}