NASA WorldWind Java ships with native readers for many standard geospatial formats, from vector files like ESRI Shapefiles and GeoJSON to elevation models in DTED and VPF, and raster imagery in GeoTIFF and RPF/CADRG. Each format has a dedicated reader class underDocumentation 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.formats or gov.nasa.worldwind.data, and most formats feed directly into WorldWind layers you can add to the globe.
Shapefiles
ESRI Shapefiles (.shp + .dbf + .shx) are loaded with ShapefileLayerFactory in gov.nasa.worldwind.formats.shapefile. The factory runs loading on a background thread and delivers a ready-to-use Layer through a CompletionCallback.
Supported shape types include:
- Point / MultiPoint →
PointPlacemarkrenderables - Polyline / PolylineZ →
ShapefilePolylinesrenderable - Polygon / PolygonZ →
ShapefilePolygonsrenderable
AttributeDelegate can be attached to the factory to style each record individually based on its DBase attributes.
Shapefiles.java — async shapefile loading with per-record attributes
createFromShapefileSource(Object) without a callback — it blocks until the layer is complete:
ShapefileLayerFactory — synchronous load
Shapefile class in the same package provides lower-level record-by-record access. Associated DBase records are available through ShapefileRecord.getAttributes(), which returns a DBaseRecord with typed field access.
GeoJSON
GeoJSON documents are parsed with theGeoJSONDoc parser in gov.nasa.worldwind.formats.geojson. The example utility class GeoJSONLoader (in gov.nasa.worldwindx.examples) wraps the parser and converts each geometry type into appropriate WorldWind renderables:
| GeoJSON Type | WorldWind Renderable |
|---|---|
Point / MultiPoint | PointPlacemark |
LineString / MultiLineString | Path (if altitude ≠ 0) or SurfacePolyline |
Polygon / MultiPolygon | Polygon (if altitude ≠ 0) or SurfacePolygon |
GeometryCollection | Recursive handling of each sub-geometry |
Feature / FeatureCollection | Geometry + properties passed to renderables |
GeoJSONLoader.java — loading GeoJSON into a layer
GeoJSONLoader.java — createLayerFromSource convenience method
properties are stored on each renderable via setValue(AVKey.PROPERTIES, properties), enabling application-level attribute-driven styling.
GPS Tracks (GPX)
GPS Exchange Format (GPX) files are read byGpxReader in gov.nasa.worldwind.formats.gpx. The reader parses track segments into a stream of Position objects, which are then visualized as Marker shapes on a MarkerLayer.
GPSTracks.java — reading a GPX file and rendering as markers
GpxReader exposes getTracks() to retrieve all parsed Track objects directly. For NMEA 0183 sentence parsing, use gov.nasa.worldwind.formats.nmea.NmeaReader.
Raster Data
WorldWind’s raster pipeline is built around theDataRasterReader interface in gov.nasa.worldwind.data. BasicDataRasterReaderFactory selects the correct reader automatically from a file’s extension and content:
| Reader Class | Supported Formats |
|---|---|
RPFRasterReader | RPF / CADRG / CIB frames |
DTEDRasterReader | DTED Level 0, 1, 2 elevation files |
GDALDataRasterReader | All GDAL-supported formats (requires native GDAL) |
GeotiffRasterReader | GeoTIFF imagery and elevation |
BILRasterReader | Band Interleaved by Line raster format |
ImageIORasterReader | PNG, JPEG, BMP via javax.imageio |
BasicDataRasterReaderFactory — auto-detecting a reader
GDAL Integration
GDALDataRasterReader delegates to the GDAL native library via JNI, enabling WorldWind to read over 100 additional formats including MrSID, ECW, HDF, NetCDF, and NITF. The reader is included in BasicDataRasterReaderFactory automatically but requires the GDAL native libraries at runtime.
GDAL support requires the GDAL native shared libraries (
gdal.dll / libgdal.so / libgdal.dylib) and the WorldWind GDAL JNI bridge on the Java library path. Without the native libraries, GDALDataRasterReader is silently skipped and files will only be read by the pure-Java readers.GDALDataRasterReader — checking GDAL availability
VPF Data
Vector Product Format (VPF) is a US military standard for digital geographic data. WorldWind providesVPFLayer for rendering VPF databases directly. VPF tiles and feature tables are accessed through gov.nasa.worldwind.formats.vpf.
VPFLayer — adding a VPF database as a layer
RPF / CADRG
RPF (Raster Product Format) frames, including Controlled Image Base (CIB) and Compressed ARC Digitized Raster Graphics (CADRG), are read byRPFRasterReader. The reader handles frame boundary stitching and zone-to-geographic coordinate conversion automatically. RPF data is typically pre-processed into WorldWind’s tiled cache format (see the next section) for best performance.
Tiled Data Cache
Large datasets should be pre-processed into WorldWind’s internal tile cache format to avoid on-the-fly projection and resampling costs. WorldWind provides producer classes ingov.nasa.worldwind.data for this purpose:
| Producer Class | Purpose |
|---|---|
TiledImageProducer | Converts imagery (GeoTIFF, PNG, etc.) to a tiled image layer cache |
TiledElevationProducer | Converts elevation data (DTED, BIL, GeoTIFF) to a tiled elevation model cache |
BasicDataRasterReaderFactory | Factory that feeds raw files into producers |
TiledImageProducer — pre-processing imagery into WorldWind tile cache