mapbox / mapbox/tile-decorator
mergeLines issues
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 36
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
A couple of line merging issues. I've already started digging into these, just recording here:
### 1. don't join reversed edges
In traffic-maps, each direction of a way is a separate geometry. They aren't offset directly in geometry. The points are simply reversed:
A -> B (northbound)
B -> A (southbound)
Because of this, tile-decorator's mergeLines function is in some cases joining traffic opposites to eachother. This cause some offsetting artifacts in the style depending on line-join setting:

### 2. adjacent edges
It seems that it's possible for mergeLines to fail merging segments that are adjacent & have identical properties

I believe this has been _possible_ before, but a recent regression has made it worse.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at tile-decorator's mergeLines function and inspect how it handles reversed and adjacent segments. Reproduce both reported cases using the issue's traffic-map examples or equivalent inputs. Done means opposite-direction edges remain separate and adjacent segments with identical properties merge without the reported style artifacts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100