(Return to the homepage.)
Disclosure: this post describes an improvement that Claude Code made, and Claude wrote the post's initial draft.
British Columbia has a lot of long, skinny, bendy lakes. The usual way to label a lake is to put its name at a single point. For a lake like that, the name ends up mostly on land:

Printed maps solve this by curving the name along the lake. You can do the same in MapLibre: give it a line through the middle of the lake, and label it with symbol-placement: line. Getting that line is the hard part.
The trick is a Voronoi diagram:

None of this is my idea.
I started with acalcutt's last release, from April 2022. But lakes mapped since then didn't have a line. And it only covers lakes, so bays and straits get nothing: no label along the Strait of Georgia, for example. So I wanted to regenerate the lines from current OSM data.
I pointed label_centerlines at British Columbia. After 14 minutes it still hadn't finished, which seemed like a lot for one province.
So I profiled a single lake: Trout Lake, which took 45 seconds on its own. 90% of the time was in shortest-path searches.
To find the longest paths, label_centerlines runs a search between every pair of dead ends in the skeleton. A skeleton has a dead end for every little bay. Trout Lake needed about 4,900 searches, and the count grows with the square of the number of dead ends, so big lakes take forever.
It turns out you only need three searches:

This is a classic trick for finding the longest path in a tree, and the skeleton is a tree, except around islands. Start at any dead end and search. The farthest dead end, a, must be one end of the longest path. Search again from a: the farthest dead end from it, b, is the other end. One more search from b gives some runner-up candidates.
Along with vectorizing some per-edge Python with Shapely 2, that took:
North America now has 37,619 lines, up from 19,053 in the 2022 release.
It isn't perfect. Lakes with lots of islands, like Babine Lake, only get a line along part of their length, because the islands break the skeleton into pieces. osm-lakelines has the same problem.
The tool is at hikeratlas/lake-centrelines. Give it an OSM PBF, and it gives you one GeoJSON line per named lake:
./lake-centrelines.sh british-columbia-latest.osm.pbf lakes.geojsonl
The labels are live on the map. Try the Strait of Georgia.