Class MercatorTileImage

  • All Implemented Interfaces:
    CoordinateTransformer


    public class MercatorTileImage
    extends Object
    implements CoordinateTransformer
    An image tile that shows a part of the world using Mercator projection. The MercatorTileImage implements the CoordinateTransformer interface and thereby transforms lon/lat coordinates to pixel coordinates on the image.
    • Constructor Summary

      Constructors

      Constructor and Description
      MercatorTileImage(int zoom, int x, int y)
      Create a tile defined by zoom, x and y and a default size of 256x256 pixels.
      MercatorTileImage(int zoom, int x, int y, int tileWidth, int tileHeight)
      Create a tile defined by zoom, x and y with a user defined width and height.
    • Constructor Detail

      • MercatorTileImage

        public MercatorTileImage(int zoom,
                                 int x,
                                 int y)
        Create a tile defined by zoom, x and y and a default size of 256x256 pixels.
        Parameters:
        zoom - the zoom level.
        x - the x coordinate.
        y - the y coordinate.
      • MercatorTileImage

        public MercatorTileImage(int zoom,
                                 int x,
                                 int y,
                                 int tileWidth,
                                 int tileHeight)
        Create a tile defined by zoom, x and y with a user defined width and height.
        Parameters:
        zoom - the zoom level.
        x - the x coordinate.
        y - the y coordinate.
        tileWidth - the width of the tile
        tileHeight - the height of the tile
    • Method Detail

      • toString

        public String toString()
      • getX

        public double getX(double lon)
      • getY

        public double getY(double lat)
      • getTileZoom

        public int getTileZoom()
        Returns:
        the zoom level.
      • getTileX

        public int getTileX()
        Returns:
        the x coordinate.
      • getTileY

        public int getTileY()
        Returns:
        the y coordinate.
      • getLon1

        public double getLon1()
        Returns:
        the leftmost longitude.
      • getLat1

        public double getLat1()
        Returns:
        the top latitude.
      • getLon2

        public double getLon2()
        Returns:
        the rightmost longitude.
      • getLat2

        public double getLat2()
        Returns:
        the bottom latitude.
      • setTileZoom

        public void setTileZoom(int tileZoom)
        Set zoom level to tileZoom.
        Parameters:
        tileZoom - the new zoom level.
      • setTileX

        public void setTileX(int tileX)
        Set the x coordinate.
        Parameters:
        tileX - the new x coordinate.
      • setTileY

        public void setTileY(int tileY)
        Set the y coordinate.
        Parameters:
        tileY - the new y coordinate.
      • getTileWidth

        public int getTileWidth()
        Get the width of the tile
        Returns:
        the width
      • getTileHeight

        public int getTileHeight()
        Get the height of the tile
        Returns:
        the height