ContourGenerator
Marching-squares contour generation, ported from the sibling iOS app's ContourGenerator.swift.
Positive elevations only: Mapterhorn's data carries bathymetry banding, and generating contours below sea level would ring every patch of open water. One pass per grid, not one pass per level: each cell's corner elevations bound which of levels can possibly cross it, so a level far outside a cell's own min,max is skipped for that cell without a full re-scan.
Functions
Link copied to clipboard
Generates every requested contour level from tile's elevation grid, chained into polylines.