com.supermap.data

Class DatasetImage



  • public class DatasetImage
    extends Dataset

    The DatasetImage class.

    The DatasetImage class, which is used to describe the image data, such as image map, multi-wave image and photo. Doesn't support 8-bit single-band images

    A raster is comprised of a two-dimensional matrix of cells, which have attributes that represent qualities such as color, spectral reflectance, or rainfall. The image dataset is used to be displayed or used as the base map, so the value of a cell is the value of a color or the value of an indexed color.

    Note: Before performing any operations, you need to call Dataset.open() method to open the dataset.

    • Method Detail

      • getWidth

        public int getWidth()
        Returns the width of the image in image dataset and the unit is pixel.
        Returns:
        the width of the raster data in the grid dataset.
      • getHeight

        public int getHeight()
        Returns the height of the image in image dataset and the unit is pixel.
        Returns:
        the height of the raster data in the grid dataset.
      • getPixelFormat

        public PixelFormat getPixelFormat()
        Returns the pixel format of the image dataset. The pixel can be expressed with the byte, bit is the unit. For more information, please refer to the PixelFormat class.

        Note: The the DatasetImage class does not support the DOUBLE,SINGLEandBIT64 pixel format.

        Returns:
        The pixel format of the image dataset.
        See Also:
        PixelFormat
      • getHasPyramid

        public boolean getHasPyramid()
        Gets a value indicates that whether the image dataset has built the pyramid. True represents that the image dataset has built the pyramid while false represents that has not.
        Returns:
        whether the image dataset has build pyramid.
      • getColorSpace

        public ColorSpaceType getColorSpace()
        Returns the color display mode.
        Returns:
        the color display mode.
      • getPixel

        public Color getPixel(int column,
                              int row,
                              int[] indexes)
        Returns the color of the specified pixel by the column, the row, and the indexes of the pixel.
        Parameters:
        column - the column of the specified pixel.
        row - the row of the specified pixel.
        indexes - the indexes of the specified pixel.
        Returns:
        the color of the specified pixel.
      • getMapCacheService

        public DatasetImage.MapCacheService getMapCacheService()
        Gets the map precache service.
        Returns:
        The map precache service.
      • getBandCount

        public int getBandCount()
        Gets the number of bands in the image dataset.
        Returns:
        the number of bands in the image dataset.
      • buildPyramid

        public boolean buildPyramid()
        To create an image pyramid, you must first close the dataset .
        Returns:
        Returns whether the image pyramid was created successfully, true if true, false otherwise.
      • updatePyramid

        public boolean updatePyramid(Rectangle2D bounds)
        Update the raster dataset image pyramid by the specified range.
        Parameters:
        bounds - The specified update bounds.
        Returns:
        Returns true if update successfully; otherwise false.
      • removePyramid

        public boolean removePyramid()
        Removes the pyramid of the grid dataset.
        Returns:
        Whether to delete success,returns true If successful; otherwise false.
      • setPyramidFirstLevel

        public void setPyramidFirstLevel(int nFirstLevel)
        Sets the first level of a pyramid to be created. 2 is by default. You can set 1, 2, 4, and so on.
        Parameters:
        nFirstLevel - the first level of a pyramid to be created.
      • getPyramidFirstLevel

        public int getPyramidFirstLevel()
        Gets the first level of a pyramid to be created. 2 is by default.
        Returns:
        the first level of a pyramid to be created.
      • setOriginalPyramid

        public void setOriginalPyramid(boolean bOriginalPyramid)
        Sets whether to use the original pyramid levels
        Parameters:
        bOriginalPyramid - whether to use the original pyramid levels
      • isOriginalPyramid

        public boolean isOriginalPyramid()
        Gets whether to use the original pyramid levels
        Return:
        whether to use the original pyramid levels
      • getCacheClipRegion

        public GeoRegion getCacheClipRegion()
        Get the tile cropping area
        Return:
        Crop Area
      • setCacheClipRegion

        public void setCacheClipRegion(GeoRegion value)
        Set the cache cropping area to obtain the contents of the tiles in the cropping area when the tile is requested. Only the Rest map service is valid.
        parameters:
        value - Crop Area
      • isCacheClipRegionEnabled

        public boolean isCacheClipRegionEnabled()
        Get the effectiveness of tile cropping
        Return:
      • setCacheClipRegionEnabled

        public void setCacheClipRegionEnabled(boolean value)
        Set whether the tile cropping is effective. Default is false,when true,setCacheClipRegion(com.supermap.data.GeoRegion) is valid.
        parameters:
        value -
      • startDownload

        public boolean startDownload(double maxScale,
                                     double minScale,
                                     GeoRegion clipRegion)
        Pre-cache according to the cropping area
        parameters:
        maxScale - Maximum Scale
        minScale - Minimum Scale
        clipRegion - Crop Area
        Return: