Class BasicRasterServer

  • All Implemented Interfaces:
    AVList, RasterServer, MessageListener, WWObject, java.beans.PropertyChangeListener, java.util.EventListener

    public class BasicRasterServer
    extends WWObjectImpl
    implements RasterServer
    BasicRasterServer maintains a list of data sources and their properties in the BasicRasterServerCache and is used to compose (mosaic) a data raster of the given region of interest from data sources.
    • Constructor Detail

      • BasicRasterServer

        public BasicRasterServer​(java.lang.Object o,
                                 AVList params)
        BasicRasterServer constructor reads a list of data raster sources from *.RasterServer.xml (the file that accompanies layer description XML file), reads sector of each source and maintains a list of data sources, their properties,
        Parameters:
        o - the RasterServer.xml source to read. May by a File, a file path, a URL or an Element
        params - optional metadata associated with the data source that might be useful to the BasicRasterServer.
    • Method Detail

      • getCache

        public MemoryCache getCache()
        Returns an instance of the MemoryCache that contains DataRasters and their properties
        Returns:
        an instance of the MemoryCache that contains DataRasters and their properties
      • hasDataRasters

        public boolean hasDataRasters()
        Returns TRUE, if the DataRaster list is not empty
        Returns:
        true, if the DataRaster list is not empty
      • init

        protected void init​(java.lang.Object o)
      • getDataSetName

        protected java.lang.String getDataSetName()
      • getDataSetPixelFormat

        protected java.lang.String getDataSetPixelFormat()
        Returns DataSet's pixel format (AVKey.IMAGE or AVKey.ELEVATION), or empty string if not set
        Returns:
        DataSet's pixel format (AVKey.IMAGE or AVKey.ELEVATION), or empty string if not set
      • setDataSetPixelFormat

        protected void setDataSetPixelFormat​(java.lang.String pixelFormat)
      • extractProperties

        protected void extractProperties​(RasterServerConfiguration config)
        Extracts all Property key and values from the given DOM element
        Parameters:
        config - Parsed configuration document.
      • readRasterSources

        protected boolean readRasterSources​(RasterServerConfiguration config)
        Reads XML document and extracts raster sources
        Parameters:
        config - Parsed configuration document.
        Returns:
        TRUE, if all raster sources are available, FALSE otherwise
      • findDataRasterReader

        protected DataRasterReader findDataRasterReader​(java.lang.Object source,
                                                        AVList params)
      • getSector

        public Sector getSector()
        Description copied from interface: RasterServer
        Returns a Geographic extend (coverage) of the composer
        Specified by:
        getSector in interface RasterServer
        Returns:
        returns a Geographic extend (coverage) of the composer as a Sector
      • composeRaster

        public DataRaster composeRaster​(AVList reqParams)
                                 throws java.lang.IllegalArgumentException,
                                        WWRuntimeException
        Composes a DataRaster of the given width and height for the specific geographic region of interest (ROI).
        Parameters:
        reqParams - This is a required parameter, must not be null or empty; Must contain AVKey.WIDTH, AVKey.HEIGHT, and AVKey.SECTOR values.

        Optional keys are: AVKey.PIXEL_FORMAT (AVKey.ELEVATION | AVKey.IMAGE) AVKey.DATA_TYPE AVKey.BYTE_ORDER (AVKey.BIG_ENDIAN | AVKey.LITTLE_ENDIAN )

        Returns:
        a DataRaster for the requested ROI
        Throws:
        WWRuntimeException - if there is no intersection of the source rasters with the requested ROI or the source format is unknown or not supported by currently loaded drivers
        java.lang.IllegalArgumentException - if any of the required parameters or values are missing
      • getRasterAsByteBuffer

        public java.nio.ByteBuffer getRasterAsByteBuffer​(AVList params)
        Composes a DataRaster of the given width and height for the specific geographic region of interest (ROI), in the requested file format (AVKey.IMAGE_FORMAT) and returns as a ByteBuffer
        Specified by:
        getRasterAsByteBuffer in interface RasterServer
        Parameters:
        params - This is a required parameter, must not be null or empty; Must contain AVKey.WIDTH, AVKey.HEIGHT, AVKey.SECTOR, and AVKey.IMAGE_FORMAT (mime type) values. Supported mime types are: "image/png", "image/jpeg", "image/dds".

        Optional keys are: AVKey.PIXEL_FORMAT (AVKey.ELEVATION | AVKey.IMAGE) AVKey.DATA_TYPE AVKey.BYTE_ORDER (AVKey.BIG_ENDIAN | AVKey.LITTLE_ENDIAN )

        Returns:
        a DataRaster for the requested ROI
        Throws:
        WWRuntimeException - if there is no intersection of the source rasters with the requested ROI or the source format is unknown or not supported by currently loaded drivers
        java.lang.IllegalArgumentException - if any of the required parameters or values are missing