public bool IsMatch(OsmObjectBase element) { if (element.HasTag(tag.Key)) { return(element.GetTagValue(tag.Key) == tag.Value); } return(false); }
/// <summary> /// Determines whether the specified OSM element is a match for this selector. /// </summary> /// <param name="element">The OSM element to check.</param> /// <returns> /// <c>true</c> if the specified element is a match; otherwise, <c>false</c>. /// </returns> public bool IsMatch(OsmObjectBase element) { foreach (OsmTag tag in tags) { bool isTagMatch = element.HasTag(tag.Key) && element.GetTagValue(tag.Key) == tag.Value; if (false == isTagMatch && operation == MultipleKeyValueSelectorOperation.And) { return(false); } if (true == isTagMatch && operation == MultipleKeyValueSelectorOperation.Or) { return(true); } } if (operation == MultipleKeyValueSelectorOperation.And) { return(true); } return(false); }