@Test
  void testMergeLineStringsIgnoresRoundingIntersections() throws Exception {
    double y = 0.5 + Z14_WIDTH / 2;
    double lat = GeoUtils.getWorldLat(y);
    double lat2a = GeoUtils.getWorldLat(y + Z14_WIDTH * 0.5 / 4096);
    double lat2b = GeoUtils.getWorldLat(y + Z14_WIDTH * 1.5 / 4096);
    double lat3 = GeoUtils.getWorldLat(y + Z14_WIDTH * 10 / 4096);

    double x1 = 0.5 + Z14_WIDTH / 4;
    double lng1 = GeoUtils.getWorldLon(x1);
    double lng2 = GeoUtils.getWorldLon(x1 + Z14_WIDTH * 10d / 256);
    double lng3 = GeoUtils.getWorldLon(x1 + Z14_WIDTH * 20d / 256);

    var results = runWithReaderFeatures(
      Map.of("threads", "1"),
      List.of(
        // group two parallel lines that almost touch at the midpoint
        // need to retain extra precision while merging to ensure it
        // doesn't confuse the line merger
        newReaderFeature(newLineString(
          lng1, lat,
          lng2, lat2a
        ), Map.of()),
        newReaderFeature(newLineString(
          lng2, lat2a,
          lng3, lat
        ), Map.of()),

        newReaderFeature(newLineString(
          lng1, lat3,
          lng2, lat2b
        ), Map.of()),
        newReaderFeature(newLineString(
          lng2, lat2b,
          lng3, lat3
        ), Map.of())
      ),
      (in, features) -> features.line("layer").setZoomRange(13, 13),
      (layer, zoom, items) -> FeatureMerge.mergeLineStrings(items, 0, 0, 0)
    );

    assertSubmap(sortListValues(Map.of(
      TileCoord.ofXYZ(Z13_TILES / 2, Z13_TILES / 2, 13), List.of(
        feature(newMultiLineString(
          newLineString(32, 64.3125, 37, 64.0625, 42, 64.3125),
          newLineString(32, 64, 37, 64.0625, 42, 64)
        ), Map.of())
      )
    )), sortListValues(results.tiles));
  }
In-memory tests with fake data and profiles to ensure all features work end-to-end.
planetiler-core/src/test/java/com/onthegomap/planetiler/PlanetilerTests.java