Skip to content

Commit

Permalink
Upgrade omt to pull in tile size optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
msbarry committed Sep 25, 2023
1 parent 2f86ea1 commit e51214e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -498,52 +498,6 @@ public String toJson() {
}
}

/**
* Contents of a row of the tiles table, or in case of compact mode in the tiles view.
*
* @deprecated Use {@link Tile} instead
*/
@Deprecated(forRemoval = true)
public record TileEntry(TileCoord tile, byte[] bytes) implements Comparable<TileEntry> {

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

TileEntry tileEntry = (TileEntry) o;

if (!tile.equals(tileEntry.tile)) {
return false;
}
return Arrays.equals(bytes, tileEntry.bytes);
}

@Override
public int hashCode() {
int result = tile.hashCode();
result = 31 * result + Arrays.hashCode(bytes);
return result;
}

@Override
public String toString() {
return "TileEntry{" +
"tile=" + tile +
", bytes=" + Arrays.toString(bytes) +
'}';
}

@Override
public int compareTo(TileEntry o) {
return tile.compareTo(o.tile);
}
}

/** Contents of a row of the tiles_shallow table. */
private record TileShallowEntry(TileCoord coord, int tileDataId) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,6 @@ public static Geometry decodeSilently(VectorTile.VectorGeometry geom) {
}
}

@Deprecated(forRemoval = true)
public static Set<Mbtiles.TileEntry> getAllTiles(ReadableTileArchive db) {
return db.getAllTiles().stream().map(t -> new Mbtiles.TileEntry(t.coord(), t.bytes())).collect(Collectors.toSet());
}

public static Set<Tile> getTiles(ReadableTileArchive db) {
return db.getAllTiles().stream().collect(Collectors.toSet());
}
Expand Down

0 comments on commit e51214e

Please sign in to comment.