Package mil.nga.gars.tile
Class TileUtils
java.lang.Object
mil.nga.gars.tile.TileUtils
Tile Utils
-
Field Summary
Modifier and TypeFieldDescriptionstatic final float
High density scalestatic final int
Displayed device-independent pixelsstatic final int
Tile pixels for default dpi tilesstatic final int
Tile pixels for high dpi tiles -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic float
density
(int tileLength) Get the density based upon the tile length (width or height)static float
density
(int tileWidth, int tileHeight) Get the density based upon the tile dimensionsstatic float
tileDensity
(float density, int tileLength) Get the tile density based upon the display density scale and tile length (width or height)static float
tileDensity
(float density, int tileWidth, int tileHeight) Get the tile density based upon the display density scale and tile dimensionsstatic int
tileLength
(float density) Get the tile side (width and height) dimension based upon the display density scalestatic int
tileLength
(Context context) Get the tile side (width and height) dimension based upon the app context display density scalestatic byte[]
Compress the bitmap to a byte arraystatic LatLng
Convert a point to a map coordinatestatic Point
Convert a map coordinate to a pointstatic Tile
Compress the bitmap to a tile
-
Field Details
-
TILE_DP
public static final int TILE_DPDisplayed device-independent pixels- See Also:
-
TILE_PIXELS_DEFAULT
public static final int TILE_PIXELS_DEFAULTTile pixels for default dpi tiles- See Also:
-
TILE_PIXELS_HIGH
public static final int TILE_PIXELS_HIGHTile pixels for high dpi tiles- See Also:
-
HIGH_DENSITY
public static final float HIGH_DENSITYHigh density scale- See Also:
-
-
Constructor Details
-
TileUtils
public TileUtils()
-
-
Method Details
-
tileLength
Get the tile side (width and height) dimension based upon the app context display density scale- Parameters:
context
- app context- Returns:
- default tile length
-
tileLength
public static int tileLength(float density) Get the tile side (width and height) dimension based upon the display density scale- Parameters:
density
- display density:DisplayMetrics.density
- Returns:
- default tile length
-
tileDensity
public static float tileDensity(float density, int tileWidth, int tileHeight) Get the tile density based upon the display density scale and tile dimensions- Parameters:
density
- display density:DisplayMetrics.density
tileWidth
- tile widthtileHeight
- tile height- Returns:
- tile density
-
tileDensity
public static float tileDensity(float density, int tileLength) Get the tile density based upon the display density scale and tile length (width or height)- Parameters:
density
- display density:DisplayMetrics.density
tileLength
- tile length (width or height)- Returns:
- tile density
-
density
public static float density(int tileWidth, int tileHeight) Get the density based upon the tile dimensions- Parameters:
tileWidth
- tile widthtileHeight
- tile height- Returns:
- density
-
density
public static float density(int tileLength) Get the density based upon the tile length (width or height)- Parameters:
tileLength
- tile length (width or height)- Returns:
- density
-
toBytes
Compress the bitmap to a byte array- Parameters:
bitmap
- bitmap- Returns:
- bytes
-
toTile
Compress the bitmap to a tile- Parameters:
bitmap
- bitmap- Returns:
- tile
-
toPoint
Convert a map coordinate to a point- Parameters:
latLng
- map coordinate- Returns:
- point
-
toLatLng
Convert a point to a map coordinate- Parameters:
point
- point- Returns:
- latLng
-