Class AbstractSingleImageLayer

  • All Implemented Interfaces:
    MapLayer
    Direct Known Subclasses:
    ImageLayer, WmsLayer

    public abstract class AbstractSingleImageLayer
    extends AbstractGeotoolsLayer
    Common implementation for layers that are represented as a single grid coverage image.
    • Field Detail

      • registry

        @Nonnull
        protected final com.codahale.metrics.MetricRegistry registry
        The metrics object.
      • configuration

        protected final Configuration configuration
        The configuration.
    • Constructor Detail

      • AbstractSingleImageLayer

        protected AbstractSingleImageLayer​(java.util.concurrent.ExecutorService executorService,
                                           StyleSupplier<org.geotools.coverage.grid.GridCoverage2D> styleSupplier,
                                           AbstractLayerParams params,
                                           com.codahale.metrics.MetricRegistry registry,
                                           Configuration configuration)
        Constructor.
        Parameters:
        executorService - the thread pool for doing the rendering.
        styleSupplier - the style to use when drawing the constructed grid coverage on the map.
        params - the parameters for this layer
        registry - the metrics object.
        configuration - the configuration
    • Method Detail

      • loadImage

        protected abstract java.awt.image.BufferedImage loadImage​(MfClientHttpRequestFactory requestFactory,
                                                                  MapfishMapContext transformer)
                                                           throws java.lang.Exception
        Load the image at the requested size for the provided map bounds.
        Parameters:
        requestFactory - the factory to use for making http requests
        transformer - object containing map rendering information
        Throws:
        java.lang.Exception
      • getImageBufferScaling

        public double getImageBufferScaling()
        Description copied from interface: MapLayer
        Get the scale ratio between the tiles resolution and the target resolution. Used to don't scale the tiles on tiled layer.
      • getStyleSupplier

        public StyleSupplier<org.geotools.coverage.grid.GridCoverage2D> getStyleSupplier()
      • createErrorImage

        protected java.awt.image.BufferedImage createErrorImage​(java.awt.Rectangle area)
        Create an error image.
        Parameters:
        area - The size of the image
      • fetchImage

        protected java.awt.image.BufferedImage fetchImage​(@Nonnull
                                                          org.springframework.http.client.ClientHttpRequest request,
                                                          @Nonnull
                                                          MapfishMapContext transformer)
                                                   throws java.io.IOException
        Fetch the given image from the web.
        Parameters:
        request - The request
        transformer - The transformer
        Returns:
        The image
        Throws:
        java.io.IOException