Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultFeatureInterpreter is broken #131

Open
YuriiNskyi opened this issue Jul 13, 2021 · 0 comments
Open

DefaultFeatureInterpreter is broken #131

YuriiNskyi opened this issue Jul 13, 2021 · 0 comments

Comments

@YuriiNskyi
Copy link

YuriiNskyi commented Jul 13, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant