@Test
  void testIssue496BaseballMultipolygon() throws Exception {
    // this generated a polygon that covered an entire z11 tile where the buffer intersected the baseball field
    OsmXml osmInfo = TestUtils.readOsmXml("issue_496_baseball_multipolygon.xml");
    List<OsmElement> elements = convertToOsmElements(osmInfo);

    var results = runWithOsmElements(
      Map.of("threads", "1"),
      elements,
      (in, features) -> {
        if (in.hasTag("natural", "sand")) {
          features.polygon("test")
            .setBufferPixels(4)
            .setPixelTolerance(0.5)
            .setMinPixelSize(0.1)
            .setAttr("id", in.id());
        }
      }
    );

    double areaAtZ14 = 20;

    for (var entry : results.tiles().entrySet()) {
      var tile = entry.getKey();
      for (var feature : entry.getValue()) {
        var geom = feature.geometry().geom();
        double area = geom.getArea();
        double expectedMaxArea = areaAtZ14 / (1 << (14 - tile.z()));
        assertTrue(area < expectedMaxArea, "tile=" + tile + " area=" + area + " geom=" + geom);
      }
    }

    assertEquals(8, results.tiles.size());
  }
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