NASA WorldWind Java ships with a comprehensive set of OGC client libraries that speak WMS, WCS, KML, GML, and OWS Common natively. TheDocumentation 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.
gov.nasa.worldwind.ogc package tree mirrors the OGC specification namespace hierarchy — ogc.wms, ogc.wcs, ogc.kml, ogc.gml, and ogc.ows — and every capabilities document type exposes a rich Java object model rather than raw XML. This lets you build service-driven globes that discover layer metadata at runtime, respond to changing server configurations, and compose imagery and elevation from multiple standards-compliant sources.
WMS Capabilities
WMSCapabilities (in gov.nasa.worldwind.ogc.wms) is the entry point for any WMS integration. Call the static WMSCapabilities.retrieve(URI) factory method to fetch and parse the GetCapabilities response from a WMS server, then call parse() to populate the object model:
FetchWMSCapabilities.java
WMSCapabilities methods:
| Method | Returns | Description |
|---|---|---|
getImageFormats() | Set<String> | MIME types the server accepts for GetMap responses |
getNamedLayers() | List<WMSLayerCapabilities> | All requestable named layers |
getLayerByName(String) | WMSLayerCapabilities | A specific layer by its <Name> element |
getRequestURL(String, String, String) | String | GetMap / GetFeatureInfo endpoint URL |
getServiceInformation() | OGCServiceInformation | Server title, abstract, keywords, contact |
getCapabilityInformation() | WMSCapabilityInformation | Layer tree and request descriptions |
WMSLayerCapabilities exposes layer-level metadata including getTitle(), getAbstract(), getBoundingBoxes(), getStyles(), and getStyleByName(String).
Creating a WMS Layer
WMSTiledImageLayer (in gov.nasa.worldwind.wms) is a BasicTiledImageLayer subclass that constructs compliant WMS GetMap request URLs from its configuration. Instantiate it with a WMSCapabilities document and an AVList of layer parameters:
CreateWMSLayer.java
AVKey parameters used by WMSTiledImageLayer:
AVKey constant | Typical value | Description |
|---|---|---|
AVKey.LAYER_NAMES | "layerA,layerB" | Comma-separated WMS layer names |
AVKey.STYLE_NAMES | "default" | Comma-separated WMS style names |
AVKey.IMAGE_FORMAT | "image/png" | GetMap response format |
AVKey.WMS_VERSION | "1.3.0" | WMS version string |
AVKey.COORDINATE_SYSTEM | "EPSG:4326" | CRS/SRS for the request |
AVKey.WMS_BACKGROUND_COLOR | "0xFFFFFF" | Transparent background color |
AVKey.DATASET_NAME | "MyLayer" | Cache key used for tile storage |
AVKey.DATA_CACHE_NAME | "MyApp/WMS/..." | File-store cache subdirectory |
If the WMS server advertises
application/bil as an image format, WorldWind’s factory system interprets the service as an elevation source and creates a WMSBasicElevationModel instead of a WMSTiledImageLayer. The WMSLayersPanel.getFactoryKeyForCapabilities() method demonstrates this detection: it checks caps.getImageFormats() for the "application/bil" substring and returns AVKey.ELEVATION_MODEL_FACTORY or AVKey.LAYER_FACTORY accordingly.WMS Layer Manager
TheWMSLayerManager example application (gov.nasa.worldwindx.examples.WMSLayerManager) demonstrates a complete UI-driven WMS browser. It uses WMSLayersPanel — a JPanel subclass that retrieves and displays all named layers from a WMS server URL, then adds or removes each selected layer from the WorldWindow.
UseWMSLayerManager.java
WMSLayersPanel pre-configures the WMS servers listed in WMSLayerManager.servers:
WMSLayerManagerServers.java
WCS Elevation
OGC Web Coverage Service (WCS) 1.0.0 endpoints that serve elevation data are handled byWCSElevationModel (in gov.nasa.worldwind.terrain). Construct it from a parsed WCS100Capabilities document:
CreateWCSElevationModel.java
CompoundElevationModel. See the Imagery & Elevation guide for the composition pattern.
KML (OGC)
KML 2.2 is an OGC standard, and WorldWind’sgov.nasa.worldwind.ogc.kml package is a full KML/KMZ parser and renderer. Loading KML from a URL — including from OGC-compliant WFS GML with KML wrappers — uses the same KMLRoot.createAndParse() entry point. See the KML & COLLADA guide for complete details.
GML Support
Thegov.nasa.worldwind.ogc.gml package provides parsers for GML 3.x geometry primitives used internally by WCS capabilities documents and elsewhere:
| Class | GML element |
|---|---|
GMLEnvelope | <gml:Envelope> — an axis-aligned bounding box |
GMLEnvelopeWithTimePeriod | Envelope with temporal extent |
GMLRectifiedGrid | <gml:RectifiedGrid> — used in WCS coverage descriptions |
GMLGrid | <gml:Grid> — grid origin and extent |
GMLPos | <gml:pos> — a single position coordinate |
GMLLimits | <gml:limits> — grid index bounds |
GMLGridEnvelope | <gml:GridEnvelope> — low/high index bounds |
GMLOrigin | <gml:origin> — grid origin position |
OWS Common
OGC OWS Common base types shared across WMS, WCS, and WFS services are ingov.nasa.worldwind.ogc.ows:
| Class | Purpose |
|---|---|
OWSCapabilities | Abstract base for all OWS-family capabilities documents |
OWSServiceIdentification | Service title, abstract, keywords, and fees |
OWSServiceProvider | Contact name, organisation, and online resource |
OWSOperationsMetadata | Declared operations and their HTTP endpoints |
OWSOperation | A single service operation descriptor |
OWSWGS84BoundingBox | Axis-aligned bounding box in WGS-84 |
OWSConstraint | Parameter constraint (allowed values list) |
OGCCapabilities base class (in gov.nasa.worldwind.ogc) provides getServiceInformation() → OGCServiceInformation and getCapabilityInformation() → OGCCapabilityInformation. WMSCapabilities extends this base:
InspectWMSServiceInfo.java
COLLADA
COLLADA 3D models are referenced from KML<Model> elements and parsed automatically by the gov.nasa.worldwind.ogc.collada package when KML is loaded. See the KML & COLLADA guide for a full description of the COLLADA pipeline and the relevant parser classes.
Full Example: WMS Layer from a Capabilities URL
The following snippet shows the complete end-to-end workflow for discovering and adding a WMS layer at runtime, suitable for embedding in an application’s “Add Layer” dialog:FullWMSSetup.java