Home / Companies / Felt / Blog / Post Details
Content Deep Dive

How Tippecanoe makes Felt’s polygons look good, part 1: choosing good label points

Blog post from Felt

Post Details
Company
Date Published
Author
Erica Fischer, Engineer
Word Count
1,626
Language
English
Hacker News Points
-
Summary

Felt has integrated Tippecanoe, a geodata pre-processing tool, to enhance the visual representation of data at various zoom levels in web maps, focusing particularly on optimizing label placement for polygons. Challenges such as choosing optimal label points and simplifying contiguous polygons without gaps have been addressed. Initially, label anchors were generated using the GEOSPointOnSurface function, but this method posed performance issues and sometimes resulted in unsatisfactory placements. Alternatives like the Polylabel algorithm and Turf's center-of-mass algorithm were explored, with the latter often offering a better balance between speed and aesthetics. However, further refinements were needed to ensure labels are placed acceptably within their polygons, avoiding borders or holes. Tippecanoe's approach also includes sorting coordinates, using grids, and, if necessary, defaulting to centroids, to find suitable label points. Duplicate labels are employed at higher zoom levels to improve map readability, and the overall process reflects a continuous effort to solve complex algorithmic problems in mapping.