/// <summary> /// Searches for a max width tag and returns the associated value. /// /// http://wiki.openstreetmap.org/wiki/Key:maxwidth /// </summary> /// <param name="attributes">The tags to search.</param> /// <param name="meter"></param> /// <returns></returns> public static bool TryGetMaxWidth(this IAttributeCollection attributes, out float meter) { meter = float.MaxValue; string tagValue; if (attributes == null || !attributes.TryGetValue("maxwidth", out tagValue) || string.IsNullOrWhiteSpace(tagValue)) { return(false); } return(IAttributeCollectionExtension.TryParseLength(tagValue, out meter)); }
/// <summary> /// Searches for a max height tag and returns the associated value. /// /// http://wiki.openstreetmap.org/wiki/Maxheight /// </summary> public static bool TryGetMaxHeight(this IReadonlyAttributeCollection tags, out float meter) { meter = float.MaxValue; string tagValue; if (tags == null || !tags.TryGetValue("maxheight", out tagValue) || string.IsNullOrWhiteSpace(tagValue)) { return(false); } return(IAttributeCollectionExtension.TryParseLength(tagValue, out meter)); }