core
core copied to clipboard
DefaultFeatureInterpreter is broken
Look at this line: https://github.com/OsmSharp/core/blob/develop/src/OsmSharp.Geo/DefaultFeatureInterpreter.cs#L524
private static AttributesTable TagsAndIdToAttributes(ICompleteOsmGeo osmObject)
{
var attr = osmObject.Tags.ToAttributeTable();
attr.Add("id", osmObject.Id); // Yes, this line
return attr;
}
The problem is: what if we already have id tag? It will simply throw ArgumentException from here and your data consumption is broken.
My proposal is to check whether AttributeTable already contains id tag, instead of precipitately adding it.