Local GeoTIFFs & DEM Terrain
For offline dome shows, high-resolution landing site flyovers, or custom scientific rasters, OpenSpace loads local GeoTIFF files directly through GDAL without requiring an external web server.
Preprocessing Rasters with GDAL
Raw satellite GeoTIFFs often ship in incompatible map projections (such as Polar Stereographic or UTM) or lack internal overview pyramids, causing severe stuttering when zooming in. Preprocess local rasters with GDAL before loading them into OpenSpace:
GlobeBrowsing expects geographic latitude/longitude (EPSG:4326 / WGS84) rasters:
gdalwarp -t_srs EPSG:4326 -r bilinear input_raw.tif output_wgs84.tif
Generates multi-resolution mipmap pyramids inside the GeoTIFF so OpenSpace doesn't read full-resolution pixels from orbit:
gdaladdo -r average output_wgs84.tif 2 4 8 16 32 64
Alternatively, convert directly to a tiled COG with built-in overviews in a single command:
gdal_translate input_wgs84.tif final_cog.tif -of COG -co COMPRESS=LZW -co OVERVIEW_RESAMPLING=AVERAGE
Loading Local Color & Elevation Layers
Use SingleImageProvider for standalone local GeoTIFFs, or TemporalTileProvider for time-series planetary datasets:
local marsAsset = asset.require("scene/solarsystem/planets/mars/mars")
local JezeroHiRISE = {
Identifier = "Jezero_HiRISE_Color",
Name = "Jezero Crater HiRISE Mosaic",
Type = "SingleImageProvider",
FilePath = asset.localResource("jezero_hirise_wgs84.tif"),
Enabled = true
}
asset.onInitialize(function()
openspace.globebrowsing.addLayer("Mars", "ColorLayers", JezeroHiRISE)
end)
asset.onDeinitialize(function()
openspace.globebrowsing.deleteLayer("Mars", "ColorLayers", "Jezero_HiRISE_Color")
end)
local marsAsset = asset.require("scene/solarsystem/planets/mars/mars")
local JezeroDEM = {
Identifier = "Jezero_HiRISE_DEM",
Name = "Jezero Crater Terrain DEM",
Type = "SingleImageProvider",
FilePath = asset.localResource("jezero_dem_wgs84.tif"),
Enabled = true,
TilePixelSize = 64
}
asset.onInitialize(function()
openspace.globebrowsing.addLayer("Mars", "HeightLayers", JezeroDEM)
end)
asset.onDeinitialize(function()
openspace.globebrowsing.deleteLayer("Mars", "HeightLayers", "Jezero_HiRISE_DEM")
end)
Screenshot Placeholder: dem-terrain-before-after.png
- Crop: Capture a split or side-by-side low-altitude oblique view of a planetary crater/canyon in OpenSpace comparing the flat ellipsoid surface (
HeightLayersdisabled) against 3D terrain relief (HeightLayersenabled). - Callouts: (1) Smooth ellipsoid horizon without DEM, (2) Displaced 3D crater rim geometry with
HeightLayersactive, (3)HeightExaggerationslider inRenderableproperties.
Troubleshooting Local Rasters
| Symptom | Cause | Fix |
|---|---|---|
| Layer loads as solid white/black box | 16-bit or 32-bit float elevation values loaded into ColorLayers instead of HeightLayers, or NoData pixels lack alpha transparency. |
Move elevation rasters to HeightLayers, or run gdalwarp -dstalpha on color imagery so NoData borders become transparent. |
| Stuttering when zooming near surface | Missing internal overviews (gdaladdo) or uncompressed multi-GB TIFF. |
Run gdaladdo or re-export as a tiled COG (-of COG). |
| Dataset appears stretched or shifted | Raster is in a projected CRS (e.g., UTM / Polar Stereographic) rather than EPSG:4326. |
Reproject with gdalwarp -t_srs EPSG:4326. |