@Test public void tileXToLongitudeTest() { for (int tileSize : TILE_SIZES) { for (byte zoomLevel = ZOOM_LEVEL_MIN; zoomLevel <= ZOOM_LEVEL_MAX; ++zoomLevel) { double longitude = MercatorProjection.tileXToLongitude(0, zoomLevel); Assert.assertEquals(LatLongUtils.LONGITUDE_MIN, longitude, 0); longitude = MercatorProjection.tileXToLongitude(0, MercatorProjection.zoomLevelToScaleFactor(zoomLevel)); Assert.assertEquals(LatLongUtils.LONGITUDE_MIN, longitude, 0); long tileX = MercatorProjection.getMapSize(zoomLevel, tileSize) / tileSize; longitude = MercatorProjection.tileXToLongitude(tileX, zoomLevel); Assert.assertEquals(LatLongUtils.LONGITUDE_MAX, longitude, 0); tileX = MercatorProjection.getMapSize(MercatorProjection.zoomLevelToScaleFactor(zoomLevel), tileSize) / tileSize; longitude = MercatorProjection.tileXToLongitude(tileX, MercatorProjection.zoomLevelToScaleFactor(zoomLevel)); Assert.assertEquals(LatLongUtils.LONGITUDE_MAX, longitude, 0); } } }
public static double tileXToLongitude(long tileX, double scaleFactor) { return pixelXToLongitude(tileX * DUMMY_TILE_SIZE, scaleFactor, DUMMY_TILE_SIZE); }
MercatorProjection { public static double tileXToLongitude(long tileX, double scaleFactor) { return pixelXToLongitude(tileX * DUMMY_TILE_SIZE, scaleFactor, DUMMY_TILE_SIZE); } }
MercatorProjection { public static double tileXToLongitude(long tileX, double scaleFactor) { return pixelXToLongitude(tileX * DUMMY_TILE_SIZE, scaleFactor, DUMMY_TILE_SIZE); } private  MercatorProjection(); }
MercatorProjection { public static double tileXToLongitude(long tileX, double scaleFactor) { return pixelXToLongitude(tileX * DUMMY_TILE_SIZE, scaleFactor, DUMMY_TILE_SIZE); } private  MercatorProjection(); static double calculateGroundResolution(double latitude, double scaleFactor, int tileSize); static double calculateGroundResolution(double latitude, byte zoomLevel, int tileSize); static LatLong fromPixels(double pixelX, double pixelY, double scaleFactor, int tileSize); static LatLong fromPixels(double pixelX, double pixelY, byte zoomLevel, int tileSize); static long getMapSize(double scaleFactor, int tileSize); static long getMapSize(byte zoomLevel, int tileSize); static Point getPixel(LatLong latLong, double scaleFactor, int tileSize); static Point getPixel(LatLong latLong, byte zoomLevel, int tileSize); static double latitudeToPixelY(double latitude, double scaleFactor, int tileSize); static double latitudeToPixelY(double latitude, byte zoomLevel, int tileSize); static long latitudeToTileY(double latitude, double scaleFactor); static long latitudeToTileY(double latitude, byte zoomLevel); static double longitudeToPixelX(double longitude, double scaleFactor, int tileSize); static double longitudeToPixelX(double longitude, byte zoomLevel, int tileSize); static long longitudeToTileX(double longitude, double scaleFactor); static long longitudeToTileX(double longitude, byte zoomLevel); static double metersToPixels(float meters, double latitude, double scaleFactor, int tileSize); static double metersToPixels(float meters, double latitude, byte zoom, int tileSize); static double pixelXToLongitude(double pixelX, double scaleFactor, int tileSize); static double pixelXToLongitude(double pixelX, byte zoomLevel, int tileSize); static long pixelXToTileX(double pixelX, double scaleFactor, int tileSize); static long pixelXToTileX(double pixelX, byte zoomLevel, int tileSize); static double pixelYToLatitude(double pixelY, double scaleFactor, int tileSize); static double pixelYToLatitude(double pixelY, byte zoomLevel, int tileSize); static long pixelYToTileY(double pixelY, double scaleFactor, int tileSize); static long pixelYToTileY(double pixelY, byte zoomLevel, int tileSize); static double scaleFactorToZoomLevel(double scaleFactor); static long tileToPixel(long tileNumber, int tileSize); static double tileXToLongitude(long tileX, double scaleFactor); static double tileXToLongitude(long tileX, byte zoomLevel); static double tileYToLatitude(long tileY, double scaleFactor); static double tileYToLatitude(long tileY, byte zoomLevel); static double zoomLevelToScaleFactor(byte zoomLevel); }
MercatorProjection { public static double tileXToLongitude(long tileX, double scaleFactor) { return pixelXToLongitude(tileX * DUMMY_TILE_SIZE, scaleFactor, DUMMY_TILE_SIZE); } private  MercatorProjection(); static double calculateGroundResolution(double latitude, double scaleFactor, int tileSize); static double calculateGroundResolution(double latitude, byte zoomLevel, int tileSize); static LatLong fromPixels(double pixelX, double pixelY, double scaleFactor, int tileSize); static LatLong fromPixels(double pixelX, double pixelY, byte zoomLevel, int tileSize); static long getMapSize(double scaleFactor, int tileSize); static long getMapSize(byte zoomLevel, int tileSize); static Point getPixel(LatLong latLong, double scaleFactor, int tileSize); static Point getPixel(LatLong latLong, byte zoomLevel, int tileSize); static double latitudeToPixelY(double latitude, double scaleFactor, int tileSize); static double latitudeToPixelY(double latitude, byte zoomLevel, int tileSize); static long latitudeToTileY(double latitude, double scaleFactor); static long latitudeToTileY(double latitude, byte zoomLevel); static double longitudeToPixelX(double longitude, double scaleFactor, int tileSize); static double longitudeToPixelX(double longitude, byte zoomLevel, int tileSize); static long longitudeToTileX(double longitude, double scaleFactor); static long longitudeToTileX(double longitude, byte zoomLevel); static double metersToPixels(float meters, double latitude, double scaleFactor, int tileSize); static double metersToPixels(float meters, double latitude, byte zoom, int tileSize); static double pixelXToLongitude(double pixelX, double scaleFactor, int tileSize); static double pixelXToLongitude(double pixelX, byte zoomLevel, int tileSize); static long pixelXToTileX(double pixelX, double scaleFactor, int tileSize); static long pixelXToTileX(double pixelX, byte zoomLevel, int tileSize); static double pixelYToLatitude(double pixelY, double scaleFactor, int tileSize); static double pixelYToLatitude(double pixelY, byte zoomLevel, int tileSize); static long pixelYToTileY(double pixelY, double scaleFactor, int tileSize); static long pixelYToTileY(double pixelY, byte zoomLevel, int tileSize); static double scaleFactorToZoomLevel(double scaleFactor); static long tileToPixel(long tileNumber, int tileSize); static double tileXToLongitude(long tileX, double scaleFactor); static double tileXToLongitude(long tileX, byte zoomLevel); static double tileYToLatitude(long tileY, double scaleFactor); static double tileYToLatitude(long tileY, byte zoomLevel); static double zoomLevelToScaleFactor(byte zoomLevel); static final double EARTH_CIRCUMFERENCE; static final double LATITUDE_MAX; static final double LATITUDE_MIN; }