Don't Label Faces When Inputs Are Lines #455
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The original behaviour when constructing a DCEL from a LineString (or MultiLineString) was to populate the face labels for half edges. They were populated with the face being marked as "absent".
The assumption was that because LineStrings are not areal, there is never a face for the that geometry in the final output. This was a valid assumption because the input disallowed GeometryCollections (i.e. a mix between areal and non-areal geometries).
If we allow GeometryCollection inputs, then the assumption is no longer valid. This is because the face may need to be included in the geometry by virtue of another (areal) part of the geometry collection (i.e. a Polygon or a MultiPolygon).
The solution in this PR is to simply not populate face labels when adding MultiLineStrings to a DCEL. If a Polygon is added to the DCEL as a later step (as we're iterating over a GeometryCollection), then that step will update the face labels accordingly.
Check List
Have you:
Added unit tests? Yes.
Add cmprefimpl tests? (if appropriate?) N/A
Updated release notes? (if appropriate?) N/A
Related Issue
This is a preliminary step for #271
Benchmark Results
Click to expand