@Test public void zoomLevelToScaleFactorTest() { for (byte zoomLevel = ZOOM_LEVEL_MIN; zoomLevel <= ZOOM_LEVEL_MAX; ++zoomLevel) { double scaleFactor = MercatorProjection.zoomLevelToScaleFactor(zoomLevel); Assert.assertEquals(zoomLevel, MercatorProjection.scaleFactorToZoomLevel(scaleFactor), 0.0001f); } }
public static double zoomLevelToScaleFactor(byte zoomLevel) { return Math.pow(2, zoomLevel); }
MercatorProjection { public static double zoomLevelToScaleFactor(byte zoomLevel) { return Math.pow(2, zoomLevel); } }
MercatorProjection { public static double zoomLevelToScaleFactor(byte zoomLevel) { return Math.pow(2, zoomLevel); } private  MercatorProjection(); }
MercatorProjection { public static double zoomLevelToScaleFactor(byte zoomLevel) { return Math.pow(2, zoomLevel); } 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 zoomLevelToScaleFactor(byte zoomLevel) { return Math.pow(2, zoomLevel); } 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; }