@Test @Category(UnitTest.class) public void tileid() { for (int tx = 0; tx < (int) (2 * Math.pow(2, zoom - 1)); tx++) { for (int ty = 0; ty < (int) (Math.pow(2, zoom - 1)); ty++) { long l = TMSUtils.tileid(tx, ty, zoom); Tile id = TMSUtils.tileid(l, zoom); Assert.assertEquals("Bad tile x", tx, id.tx); Assert.assertEquals("Bad tile y", ty, id.ty); } } long l = TMSUtils.tileid(123, 456, zoom); Assert.assertEquals("Bad tile id", 467067, l); Tile id = TMSUtils.tileid(123456, zoom); Assert.assertEquals("Bad tile x", 576, id.tx); Assert.assertEquals("Bad tile y", 120, id.ty); }
public static Tile tileid(long tileid, int zoomlevel) { long width = (long) Math.pow(2, zoomlevel); long ty = tileid / width; long tx = tileid - (ty * width); return new Tile(tx, ty); }
TMSUtils { public static Tile tileid(long tileid, int zoomlevel) { long width = (long) Math.pow(2, zoomlevel); long ty = tileid / width; long tx = tileid - (ty * width); return new Tile(tx, ty); } }
TMSUtils { public static Tile tileid(long tileid, int zoomlevel) { long width = (long) Math.pow(2, zoomlevel); long ty = tileid / width; long tx = tileid - (ty * width); return new Tile(tx, ty); }  }
TMSUtils { public static Tile tileid(long tileid, int zoomlevel) { long width = (long) Math.pow(2, zoomlevel); long ty = tileid / width; long tx = tileid - (ty * width); return new Tile(tx, ty); }  static Bounds limit(Bounds bounds); static TileBounds boundsToTile(Bounds bounds, int zoom,
    int tilesize); static TileBounds boundsToTileExact(Bounds bounds, int zoom,
    int tilesize); static Tile calculateTile(Tile tile, int srcZoom, int dstZoom,
    int tilesize); static boolean isValidTile(long tx, long ty, int zoomlevel); static Pixel latLonToPixels(double lat, double lon, int zoom,
    int tilesize); static Pixel latLonToPixelsUL(double lat, double lon, int zoom,
    int tilesize); static Tile latLonToTile(double lat, double lon, int zoom,
    int tilesize); static Pixel latLonToTilePixel(double lat, double lon, long tx,
    long ty, int zoom, int tilesize); static Pixel latLonToTilePixelUL(double lat, double lon, long tx,
    long ty, int zoom, int tilesize); static long numXTiles(int zoomlevel); static long numYTiles(int zoomlevel); static Tile pixelsToTile(double px, double py, int tilesize); static Tile pixelsULToTile(double px, double py, int zoom,
    int tilesize); static LatLon pixelToLatLon(long px, long py, int zoom,
    int tilesize); static LatLon pixelToLatLonUL(long px, long py, int zoom,
    int tilesize); static LatLon tilePixelToLatLon(long px, long py, Tile tile, int zoom,
    int tilesize); static LatLon tilePixelULToLatLon(long px, long py, Tile tile, int zoom,
    int tilesize); static double resolution(int zoom, int tilesize); static Bounds tileBounds(long tx, long ty, int zoom, int tilesize); static Bounds tileBounds(Tile tile, int zoom, int tilesize); static Bounds tileBounds(Bounds bounds, int zoom, int tilesize); static double[] tileBoundsArray(long tx, long ty, int zoom,
    int tilesize); static Tile tileid(long tileid, int zoomlevel); static long tileid(long tx, long ty, int zoomlevel); static long maxTileId(int zoomlevel); static double[] tileSWNEBoundsArray(long tx, long ty, int zoom,
    int tilesize); static Bounds tileToBounds(TileBounds bounds, int zoom,
    int tilesize); static int zoomForPixelSize(double pixelSize, int tilesize); }
TMSUtils { public static Tile tileid(long tileid, int zoomlevel) { long width = (long) Math.pow(2, zoomlevel); long ty = tileid / width; long tx = tileid - (ty * width); return new Tile(tx, ty); }  static Bounds limit(Bounds bounds); static TileBounds boundsToTile(Bounds bounds, int zoom,
    int tilesize); static TileBounds boundsToTileExact(Bounds bounds, int zoom,
    int tilesize); static Tile calculateTile(Tile tile, int srcZoom, int dstZoom,
    int tilesize); static boolean isValidTile(long tx, long ty, int zoomlevel); static Pixel latLonToPixels(double lat, double lon, int zoom,
    int tilesize); static Pixel latLonToPixelsUL(double lat, double lon, int zoom,
    int tilesize); static Tile latLonToTile(double lat, double lon, int zoom,
    int tilesize); static Pixel latLonToTilePixel(double lat, double lon, long tx,
    long ty, int zoom, int tilesize); static Pixel latLonToTilePixelUL(double lat, double lon, long tx,
    long ty, int zoom, int tilesize); static long numXTiles(int zoomlevel); static long numYTiles(int zoomlevel); static Tile pixelsToTile(double px, double py, int tilesize); static Tile pixelsULToTile(double px, double py, int zoom,
    int tilesize); static LatLon pixelToLatLon(long px, long py, int zoom,
    int tilesize); static LatLon pixelToLatLonUL(long px, long py, int zoom,
    int tilesize); static LatLon tilePixelToLatLon(long px, long py, Tile tile, int zoom,
    int tilesize); static LatLon tilePixelULToLatLon(long px, long py, Tile tile, int zoom,
    int tilesize); static double resolution(int zoom, int tilesize); static Bounds tileBounds(long tx, long ty, int zoom, int tilesize); static Bounds tileBounds(Tile tile, int zoom, int tilesize); static Bounds tileBounds(Bounds bounds, int zoom, int tilesize); static double[] tileBoundsArray(long tx, long ty, int zoom,
    int tilesize); static Tile tileid(long tileid, int zoomlevel); static long tileid(long tx, long ty, int zoomlevel); static long maxTileId(int zoomlevel); static double[] tileSWNEBoundsArray(long tx, long ty, int zoom,
    int tilesize); static Bounds tileToBounds(TileBounds bounds, int zoom,
    int tilesize); static int zoomForPixelSize(double pixelSize, int tilesize); final static int MAXZOOMLEVEL; }