private List<RangeWithTags> computeLinearRangesAtZoom(int zoom) {
      record Partial(boolean omit, Map<String, Object> attrs) {
        Partial withOmit(boolean newValue) {
          return new Partial(newValue || omit, attrs);
        }

        Partial merge(Partial other) {
          return new Partial(other.omit, MapUtil.merge(attrs, other.attrs));
        }

        Partial withAttr(String key, Object value) {
          return new Partial(omit, MapUtil.with(attrs, key, value));
        }
      }
      MergingRangeMap<Partial> result = MergingRangeMap.unit(new Partial(false, getAttrsAtZoom(zoom)), Partial::merge);
      for (var override : partialOverrides) {
        result.update(override.range(), m -> switch (override) {
          case Attr attr -> m.withAttr(attr.key, unwrap(attr.value, zoom));
          case Maxzoom mz -> m.withOmit(mz.maxzoom < zoom);
          case Minzoom mz -> m.withOmit(mz.minzoom > zoom);
          case Omit ignored -> m.withOmit(true);
        });
      }
      var ranges = result.result();
      List<RangeWithTags> rangesWithGeometries = new ArrayList<>(ranges.size());
      for (var range : ranges) {
        var value = range.value();
        if (!value.omit) {
          try {
            rangesWithGeometries.add(new RangeWithTags(
              range.start(),
              range.end(),
              source.partialLine(range.start(), range.end()),
              value.attrs
            ));
          } catch (GeometryException e) {
            throw new IllegalStateException(e);
          }
        }
      }
      return rangesWithGeometries;
    }
Computes and returns the linear-scoped attributes of this line, and the geometry they apply to.
planetiler-core/src/main/java/com/onthegomap/planetiler/FeatureCollector.java