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

Adopt numpy-hash approach to find duplicates #82

Merged
merged 1 commit into from
May 15, 2020

Conversation

mattijn
Copy link
Owner

@mattijn mattijn commented May 15, 2020

This PR implements the method as prototyped in #78.

The method collects the hash identifiers of sorted linestring coordinates through tuples. With this approach every linestring can be represented as an equal length integer.

One side-effect are rotated rings. Using the shapely shared_paths function for junction detection these are not equal anymore as the hash is not the same. With a ring, the first and last coordinate are the same, but if the ring is rotated than these first and last coordinate are not the same anymore and so not the hash.

With the dictlist coords approach the first/last coordinated of a ring is seen as a junction so a rotated polygon is split in two duplicate segments.

Eg. test https://github.com/mattijn/topojson/blob/master/tests/test_cut.py#L58:L66 and two more were changed to capture this new behavior.

@mattijn mattijn merged commit 945d23b into master May 15, 2020
@mattijn mattijn deleted the replace-find-duplicates branch May 15, 2020 19:20
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

Successfully merging this pull request may close these issues.

None yet

1 participant