public static void main(String[] args) throws Exception {


    Arguments arguments = Arguments.fromArgs(args);
    String dbPath0 = arguments.getString("bench_mbtiles0", "the first mbtiles file", null);
    String dbPath1 = arguments.getString("bench_mbtiles1", "the second mbtiles file", null);
    boolean failOnFeatureDiff = arguments.getBoolean("bench_fail_on_feature_diff", "fail on feature diff", false);

    try (
      var db0 = Mbtiles.newReadOnlyDatabase(Path.of(dbPath0));
      var db1 = Mbtiles.newReadOnlyDatabase(Path.of(dbPath1))
    ) {
      long tilesCount0 = getTilesCount(db0);
      long tilesCount1 = getTilesCount(db1);
      if (tilesCount0 != tilesCount1) {
        throw new IllegalArgumentException(
          "expected tiles count to be equal but tilesCount0=%d tilesCount1=%d".formatted(tilesCount0, tilesCount1)
        );
      }

      int lastPercentage = -1;
      long processedTileCounter = 0;
      long tilesWithDiffs = 0;
      try (var statement = db0.connection().prepareStatement("select tile_column, tile_row, zoom_level from tiles")) {
        var rs = statement.executeQuery();
        while (rs.next()) {
          processedTileCounter++;
          int x = rs.getInt("tile_column");
          int y = rs.getInt("tile_row");
          int z = rs.getInt("zoom_level");
          TileCoord coord = TileCoord.ofXYZ(x, (1 << z) - 1 - y, z);

          int currentPercentage = (int) (processedTileCounter * 100 / tilesCount0);
          if (lastPercentage != currentPercentage) {
            LOGGER.info("processed {}%", currentPercentage);
          }
          lastPercentage = currentPercentage;

          var features0 = decode(gunzip(db0.getTile(coord)))
            .stream()
            .map(VectorTileFeatureForCmp::fromActualFeature)
            .collect(Collectors.toSet());
          var features1 = decode(gunzip(db1.getTile(coord)))
            .stream()
            .map(VectorTileFeatureForCmp::fromActualFeature)
            .collect(Collectors.toSet());

          if (!features0.equals(features1)) {
            ++tilesWithDiffs;

            var tilesDifferException = new TilesDifferException(coord, features0, features1);
            if (failOnFeatureDiff) {
              throw tilesDifferException;
            } else {
              LOGGER.warn(tilesDifferException.getMessage());
            }
          }
        }
      }

      LOGGER.info("totalTiles={} tilesWithDiffs={}", processedTileCounter, tilesWithDiffs);
    }
  }
A utility to compare two mbtiles files.
<p>
See {@link VectorTileFeatureForCmp} for comparison rules. The results planetiler produces are not necessarily stable,
so sometimes a few feature may be different in one tile. Also POI coordinates may sometimes differ slightly. This
should get fixed in https://github.com/onthegomap/planetiler/issues/215
<p>
=> The tool helps to see if two mbtiles files are (mostly) identical.
planetiler-core/src/main/java/com/onthegomap/planetiler/mbtiles/Compare.java