NASA WorldWind Java separates the globe’s visual appearance into two independent data streams: imagery (color tiles painted on the globe surface) and elevation (a height field that shapes the 3D terrain mesh). Both are managed through a pluggable model system — imagery throughDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nasaworldwind/worldwindjava/llms.txt
Use this file to discover all available pages before exploring further.
Layer subclasses added to the LayerList, and elevation through ElevationModel implementations attached to the Globe. Understanding this architecture lets you mix and overlay satellite products, local raster files, WMS services, and custom elevation grids in a single scene.
Tiled Image Layers
The primary mechanism for serving imagery in WorldWind is the tiled image layer system. The abstract baseTiledImageLayer divides the globe into a hierarchy of geographic tiles at increasing levels of detail. BasicTiledImageLayer is the standard concrete implementation and also implements BulkRetrievable for offline pre-caching.
Key configuration parameters (passed as an AVList):
AVKey constant | Description |
|---|---|
AVKey.LEVEL_ZERO_TILE_DELTA | Tile size at level 0 (a LatLon, e.g., 36°×36°) |
AVKey.NUM_LEVELS | Total number of detail levels |
AVKey.NUM_EMPTY_LEVELS | Coarsest levels with no imagery (skipped at startup) |
AVKey.FORMAT_SUFFIX | File extension for cached tiles (e.g., ".dds", ".jpg") |
AVKey.DATA_CACHE_NAME | Cache folder name under the WorldWind file store |
AVKey.TILE_WIDTH / AVKey.TILE_HEIGHT | Pixel dimensions of each tile (commonly 512) |
AVKey.DATASET_NAME | Logical name for the dataset |
ConfigureTiledImageLayer.java
~/.worldwind/). Subsequent application launches reuse cached tiles without a network round-trip.
WMS Imagery Layers
WorldWind shipsWMSTiledImageLayer — a subclass of BasicTiledImageLayer — that constructs GetMap request URLs from a WMSCapabilities document. The WMSLayersPanel UI component (used in the WMSLayerManager example) demonstrates the complete pattern.
CreateWMSImageLayer.java
WMSTiledImageLayer builds tile URLs automatically from the WMSCapabilities bounding boxes, projection, and version. For servers that advertise application/bil format, WorldWind’s factory system may instead create a WMSBasicElevationModel, so always check caps.getImageFormats() before deciding which product to instantiate.WMSLayersPanel helper component (in gov.nasa.worldwindx.examples) encapsulates this pattern in a Swing UI that lists all named layers from a server URL and lets the user toggle them on and off. Pass it a WorldWindow, a server URL string, and a preferred Dimension:
UseWMSLayersPanel.java
Local Raster Imagery
SurfaceImageLayer
SurfaceImageLayer (in gov.nasa.worldwind.layers) is a RenderableLayer subclass that accepts local image files and automatically reprojects them to geographic coordinates when geo-referencing metadata is present. It handles GeoTIFF, JPEG2000, and other formats supported by the registered DataRasterReader implementations.
LoadLocalGeoTIFF.java
SurfaceImage (single renderable)
For a single georeferenced image added directly to anyRenderableLayer, use the SurfaceImage renderable. Corners are specified as an ordered list of LatLon points (counter-clockwise from lower-left):
AddSurfaceImage.java
Custom Elevation Models
WorldWind separates terrain elevation from imagery through theElevationModel interface. The active elevation model is held by the Globe object and can be a single model or a CompoundElevationModel that composites multiple sources.
BasicElevationModel
BasicElevationModel is the standard tiled elevation implementation, configured the same way as BasicTiledImageLayer via an AVList. It also implements BulkRetrievable and supports formats like BIL (binary interleaved), DTED, and GeoTIFF via the configured DataRasterReader.
ConfigureElevationModel.java
LocalElevationModel
LocalElevationModel reads elevation data directly from local files without a tile hierarchy — ideal for small regional datasets or offline deployments. Call addElevations(File) or addElevations(String filename) to load each file:
LoadLocalElevation.java
LocalElevationModel is best constructed off the Event Dispatch Thread. Loading large raster files synchronously on the EDT will freeze the UI. Use a SwingWorker or a background thread, then update the globe’s elevation model on completion.CompoundElevationModel
To combine multiple elevation sources — for example, a coarse global DEM with a fine-resolution local patch on top — wrap them in aCompoundElevationModel. Models added at lower indices have lower priority; models added later take precedence in areas they cover:
ComposeElevationModels.java
WCS Elevation
For elevation data exposed through an OGC Web Coverage Service (WCS), useWCSElevationModel. It is constructed from a WCS100Capabilities document and an AVList specifying coverage parameters:
CreateWCSElevationModel.java
Bulk Download
BothBasicTiledImageLayer and BasicElevationModel implement the BulkRetrievable interface, which allows pre-caching all tiles for a sector and resolution level before going offline. Call makeLocal(Sector, double, BulkRetrievalListener) to start a BulkRetrievalThread:
BulkDownloadTiles.java
BulkDownloadPanel example component (gov.nasa.worldwindx.examples.BulkDownloadPanel) provides a ready-made Swing UI around this API, showing per-layer progress bars and estimated download sizes.
Downloaded tiles are stored in the WorldWind file store (
WorldWind.getDataFileStore()). By default this is ~/.worldwind/ on macOS/Linux and %APPDATA%\.worldwind\ on Windows. You can redirect the file store location by setting the gov.nasa.worldwind.platform.fileStoreLocation configuration property.