public static long tmsPositionToXY(int z, int pos) {
    if (z == 0)
      return 0;
    int dim = 1 << z;
    int x = pos / dim;
    int y = dim - 1 - (pos % dim);
    return ((long) x << 32) | y;
  }
Return the equivalent tile index using Hilbert ordering on a single level instead of TMS.
planetiler-core/src/main/java/com/onthegomap/planetiler/geo/TileCoord.java