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

Fix single nested relations issue in RawAtlasGenerator #212

Merged
merged 2 commits into from
Sep 4, 2018

Conversation

matthieun
Copy link
Collaborator

Description:

In case a relation (A) has a single member and that member is a point that is exactly duplicated by another point, and that relation's (A) point is the one marked for "duplicate removal" by the RawAtlasGenerator, the PackedAtlasBuilder would throw an AtlasIntegrityException complaining that referencing the relation (A) (which is removed) as a member of relation (B) was illegal. This PR keeps track of this case by making sure relation (A) is also removed as a member from relation (B).

Potential Impact:

No AtlasIntegrityException in that use case.

Unit Test Approach:

Created a fake PBF file with 2 overlapping nodes, both only members single relations which are only members of another relation each. Checking that the resulting RawAtlas contains only 2 relations and not 4, and that no AtlasIntegrityException is thrown.

Also added .osm file for reference.

Test Results:

There are only two relations, and no AtlasIntegrityException is thrown.


In doubt: Contributing Guidelines

logger.debug("Relation {} bean is empty, dropping from Atlas",
relation.getIdentifier());
final long relationIdentifier = relation.getIdentifier();
logger.debug("Relation {} bean is empty, dropping from Atlas", relationIdentifier);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RelationBean is an internal PackedAtlas term referring to the relation's collection of members.

Copy link
Contributor

@jwpgage jwpgage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment about a possible typo, otherwise this looks good! Thanks for the quick fix and test

@jwpgage jwpgage merged commit 351a9c6 into osmlab:dev Sep 4, 2018
@matthieun matthieun deleted the duplicate branch September 4, 2018 22:03
@matthieun matthieun added this to the 5.1.11 milestone Sep 4, 2018
Copy link
Contributor

@MikeGost MikeGost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix and test, thank you!

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

Successfully merging this pull request may close these issues.

3 participants