rename Tile.TILE_SIZE to Tile.SIZE, while I'm at refactoring
This commit is contained in:
@@ -591,9 +591,9 @@ public class MapDatabase implements IMapDatabase {
|
||||
Tag[] tags = null;
|
||||
Tag[] curTags;
|
||||
|
||||
long x = mTile.tileX * Tile.TILE_SIZE;
|
||||
long y = mTile.tileY * Tile.TILE_SIZE + Tile.TILE_SIZE;
|
||||
long z = Tile.TILE_SIZE << mTile.zoomLevel;
|
||||
long x = mTile.tileX * Tile.SIZE;
|
||||
long y = mTile.tileY * Tile.SIZE + Tile.SIZE;
|
||||
long z = Tile.SIZE << mTile.zoomLevel;
|
||||
|
||||
long dx = (x - (z >> 1));
|
||||
long dy = (y - (z >> 1));
|
||||
@@ -1055,9 +1055,9 @@ public class MapDatabase implements IMapDatabase {
|
||||
|
||||
private boolean projectToTile(float[] coords, short[] indices) {
|
||||
|
||||
long x = mTile.tileX * Tile.TILE_SIZE;
|
||||
long y = mTile.tileY * Tile.TILE_SIZE + Tile.TILE_SIZE;
|
||||
long z = Tile.TILE_SIZE << mTile.zoomLevel;
|
||||
long x = mTile.tileX * Tile.SIZE;
|
||||
long y = mTile.tileY * Tile.SIZE + Tile.SIZE;
|
||||
long z = Tile.SIZE << mTile.zoomLevel;
|
||||
|
||||
double divx, divy = 0;
|
||||
long dx = (x - (z >> 1));
|
||||
@@ -1081,7 +1081,7 @@ public class MapDatabase implements IMapDatabase {
|
||||
|
||||
lon = (float) ((coords[pos]) / divx - dx);
|
||||
double sinLat = Math.sin(coords[pos + 1] * PI180);
|
||||
lat = (float) (Tile.TILE_SIZE - (Math.log((1.0 + sinLat) / (1.0 - sinLat)) * divy + dy));
|
||||
lat = (float) (Tile.SIZE - (Math.log((1.0 + sinLat) / (1.0 - sinLat)) * divy + dy));
|
||||
|
||||
if (cnt != 0) {
|
||||
// drop small distance intermediate nodes
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Projection {
|
||||
* @return the longitude value of the tile X number.
|
||||
*/
|
||||
public static double tileXToLongitude(long tileX, int zoomLevel) {
|
||||
return MercatorProjection.pixelXToLongitude(tileX * Tile.TILE_SIZE, zoomLevel);
|
||||
return MercatorProjection.pixelXToLongitude(tileX * Tile.SIZE, zoomLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,7 +45,7 @@ public class Projection {
|
||||
* @return the latitude value of the tile Y number.
|
||||
*/
|
||||
public static double tileYToLatitude(long tileY, int zoomLevel) {
|
||||
return MercatorProjection.pixelYToLatitude(tileY * Tile.TILE_SIZE, zoomLevel);
|
||||
return MercatorProjection.pixelYToLatitude(tileY * Tile.SIZE, zoomLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,7 +86,7 @@ public class Projection {
|
||||
* @return the tile X number.
|
||||
*/
|
||||
public static int pixelXToTileX(double pixelX, int zoomLevel) {
|
||||
return (int) Math.min(Math.max(pixelX / Tile.TILE_SIZE, 0),
|
||||
return (int) Math.min(Math.max(pixelX / Tile.SIZE, 0),
|
||||
Math.pow(2, zoomLevel) - 1);
|
||||
}
|
||||
/**
|
||||
@@ -99,7 +99,7 @@ public class Projection {
|
||||
* @return the tile Y number.
|
||||
*/
|
||||
public static int pixelYToTileY(double pixelY, int zoomLevel) {
|
||||
return (int) Math.min(Math.max(pixelY / Tile.TILE_SIZE, 0),
|
||||
return (int) Math.min(Math.max(pixelY / Tile.SIZE, 0),
|
||||
Math.pow(2, zoomLevel) - 1);
|
||||
}
|
||||
private Projection(){
|
||||
|
||||
@@ -205,7 +205,7 @@ final class RequiredFields {
|
||||
static OpenResult readTilePixelSize(ReadBuffer readBuffer, MapFileInfoBuilder mapFileInfoBuilder) {
|
||||
// get and check the tile pixel size (2 bytes)
|
||||
int tilePixelSize = readBuffer.readShort();
|
||||
// if (tilePixelSize != Tile.TILE_SIZE) {
|
||||
// if (tilePixelSize != Tile.SIZE) {
|
||||
// return new FileOpenResult("unsupported tile pixel size: " + tilePixelSize);
|
||||
// }
|
||||
mapFileInfoBuilder.tilePixelSize = tilePixelSize;
|
||||
|
||||
@@ -86,7 +86,7 @@ public class MapDatabase implements IMapDatabase {
|
||||
mMapGenerator = mapDatabaseCallback;
|
||||
|
||||
// scale coordinates to tile size
|
||||
mScaleFactor = REF_TILE_SIZE / Tile.TILE_SIZE;
|
||||
mScaleFactor = REF_TILE_SIZE / Tile.SIZE;
|
||||
|
||||
File f = null;
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ public class MapDatabase implements IMapDatabase {
|
||||
mCurTagCnt = 0;
|
||||
|
||||
// scale coordinates to tile size
|
||||
mScaleFactor = REF_TILE_SIZE / Tile.TILE_SIZE;
|
||||
mScaleFactor = REF_TILE_SIZE / Tile.SIZE;
|
||||
|
||||
File f = null;
|
||||
|
||||
@@ -532,7 +532,7 @@ public class MapDatabase implements IMapDatabase {
|
||||
lastX = lon + lastX;
|
||||
lastY = lat + lastY;
|
||||
coords[cnt++] = lastX / scale;
|
||||
coords[cnt++] = Tile.TILE_SIZE - lastY / scale;
|
||||
coords[cnt++] = Tile.SIZE - lastY / scale;
|
||||
}
|
||||
|
||||
mGeom.index[0] = (short)numNodes;
|
||||
@@ -722,7 +722,7 @@ public class MapDatabase implements IMapDatabase {
|
||||
} else {
|
||||
y = ((result >>> 1) ^ -(result & 1));
|
||||
lastY = lastY + y;
|
||||
coords[cnt++] = Tile.TILE_SIZE - lastY / scale;
|
||||
coords[cnt++] = Tile.SIZE - lastY / scale;
|
||||
even = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class MapDatabase implements IMapDatabase {
|
||||
@Override
|
||||
public QueryResult executeQuery(JobTile tile, IMapDatabaseCallback mapDatabaseCallback) {
|
||||
|
||||
int size = Tile.TILE_SIZE;
|
||||
int size = Tile.SIZE;
|
||||
float[] points = mGeom.points;
|
||||
short[] index = mGeom.index;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user