Class TLcdEarthGXYElevationRasterPainter

All Implemented Interfaces:
ILcdCloneable, ILcdPropertyChangeSource, ILcdStatusSource, ILcdGXYPainter, ILcdGXYPainterProvider, Serializable, Cloneable

public class TLcdEarthGXYElevationRasterPainter extends TLcdEarthGXYSinglevaluedRasterPainter
This ILcdGXYPainter can paint the elevation data of ILcdEarthTileSet instances in a 2D view.

This painter has been replaced by TLcdGXYImagePainter. Please consider using it instead of this one.

Supported objects

This painter can visualize any ILcdEarthTileSet that can produce tiles with a TLcdEarthElevationData as the tile data. The first such coverage in the tileset will be used (see TLcdEarthGXYRasterPainter.chooseTileSetCoverage(com.luciad.earth.tileset.ILcdEarthTileSet)).

Visualization

To visualize the elevation data, each value is first converted to a short which is then mapped to a color using the color model. By default a standard color model is already set.

By default the tile level is chosen such that 4 pixels in the view map to at least one value, if possible. This avoids most pixelation effects (e.g. that individual pixels are visible). To achieve this a tile level is chosen with a higher pixel density than the view. This behavior can be changed by either setting the quality or by overriding the TLcdEarthGXYRasterPainter.chooseTileSetLevel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext, com.luciad.shape.ILcdBounds) method.

If some tiles are not available, the tiles at lower levels will be used automatically to avoid gaps.

If required this painter will warp the elevation data between different coordinate systems, otherwise it will just paint their linearly scaled images.

The bounds of the tile set will be painted instead of the tiles if the pixel density of the least detailed level is too high. There is no limit on the pixel density by default so the bounds of a tile set will never be painted unless the start resolution factor is set to a lower value. Typically this is fine for tile sets that cover the entire world but it may be necessary to lower the start resolution factor if there are multiple smaller tile sets in a view.

Incremental visualization

If the tileset supports asynchronous tile production, the visualization can be done incrementally. This means that the tiles will be requested asynchronously and the view will be repainted as the tiles become available. To enable this the ALcdEarthGXYPainter.isAsynchronousTileRequestAllowed() and ALcdEarthGXYPainter.isRepaintViewWhenTileAvailable() should be set to true (default).

Caching

By default only the tiles necessary for the view will be cached using hard references (see TLcdEarthGXYRasterPainter.setCacheSize(int)). Other tiles will also be cached if there is enough memory (see TLcdEarthGXYRasterPainter.isSoftCachingEnabled()). Tiles that reside in either of these caches will be updated automatically every minute (see TLcdEarthGXYRasterPainter.getUpdateInterval()). You can use the TLcdEarthGXYRasterPainter.updateTiles(com.luciad.view.gxy.ILcdGXYView) method to update all tiles that are currently cached immediately.

Performance considerations

  • To achieve optimal performance the reference of the tileset and the world reference should match. If this is not the case the raster data will need to be warped on-the-fly.
  • When incremental visualization is enabled other layers may also be repainted more frequently. This could result in reduced performance if this takes too much time.
  • When incremental visualization is enabled in combination with asynchronous painting it may sometimes take a significant amount of time before a paint is completed. More specifically this situation occurs if the painting is interrupted before it can finish due to a repaint for tile that has just become available. To avoid this you can disable the interruption of paints (see TLcdGXYAsynchronousPaintQueue.setInterruptPainting(boolean))
Since:
8.2
See Also: