Class MGRSTile


  • public class MGRSTile
    extends Object
    Military Grid Reference System Tile
    Author:
    wnewman, osbornb
    • Constructor Detail

      • MGRSTile

        public MGRSTile​(int width,
                        int height,
                        int x,
                        int y,
                        int zoom)
        Constructor
        Parameters:
        width - tile width
        height - tile height
        x - x coordinate
        y - y coordinate
        zoom - zoom level
      • MGRSTile

        public MGRSTile​(int width,
                        int height,
                        Bounds bounds)
        Constructor
        Parameters:
        width - tile width
        height - tile height
        bounds - tile bounds
    • Method Detail

      • create

        public static MGRSTile create​(int width,
                                      int height,
                                      int x,
                                      int y,
                                      int zoom)
        Create a tile
        Parameters:
        width - tile width
        height - tile height
        x - x coordinate
        y - y coordinate
        zoom - zoom level
        Returns:
        tile
      • create

        public static MGRSTile create​(int width,
                                      int height,
                                      Bounds bounds)
        Create a tile
        Parameters:
        width - tile width
        height - tile height
        bounds - tile bounds
        Returns:
        tile
      • getWidth

        public int getWidth()
        Get the tile width
        Returns:
        tile width
      • getHeight

        public int getHeight()
        Get the tile height
        Returns:
        tile height
      • getZoom

        public int getZoom()
        Get the zoom level
        Returns:
        zoom level
      • getBounds

        public Bounds getBounds()
        Get the tile bounds
        Returns:
        bounds
      • getBounds

        public Bounds getBounds​(Unit unit)
        Get the bounds in the units
        Parameters:
        unit - units
        Returns:
        bounds in units
      • getBoundsDegrees

        public Bounds getBoundsDegrees()
        Get the bounds in degrees
        Returns:
        bounds in degrees
      • getBoundsMeters

        public Bounds getBoundsMeters()
        Get the bounds in meters
        Returns:
        bounds in meters
      • getPixel

        public Pixel getPixel​(Point point)
        Get the point pixel location in the tile
        Parameters:
        point - point
        Returns:
        pixel
      • getXPixel

        public float getXPixel​(double longitude)
        Get the longitude in meters x pixel location in the tile
        Parameters:
        longitude - longitude in meters
        Returns:
        x pixel
      • getYPixel

        public float getYPixel​(double latitude)
        Get the latitude (in meters) y pixel location in the tile
        Parameters:
        latitude - latitude in meters
        Returns:
        y pixel