public static int encode(int x, int y, int z) {
    return startIndexForZoom(z) + tmsXYToPosition(z, x, y);
  }
Returns the tile containing a latitude/longitude coordinate at a given zoom level.
planetiler-core/src/main/java/com/onthegomap/planetiler/geo/TileCoord.java