How to Use an HGT File Viewer — Step-by-Step Guide for BeginnersHGT files store elevation data exported from the Shuttle Radar Topography Mission (SRTM). They’re essentially digital elevation models (DEMs) that represent the terrain as a grid of height values (usually in meters above sea level). If you’re new to HGT files, this guide walks you through everything you need: what HGT files are, how to open and inspect them with an HGT file viewer, how to visualize and analyze the data, and common workflows for beginners.
What is an HGT file?
- HGT is a raster DEM format containing regularly spaced elevation samples.
- Most HGT files use a grid resolution of 1 arc-second (~30 meters) or 3 arc-seconds (~90 meters) depending on the data release.
- File names usually encode the southwest corner coordinates (for example: N37W122.hgt = tile covering latitudes 37–38°N and longitudes 122–121°W).
- Values are stored as signed 16-bit integers; special values (commonly -32768) represent voids or missing data.
Choose an HGT file viewer
There are many viewers and GIS tools that support HGT. For beginners, choose one based on your needs:
- Simple viewers (quick visualization): QGIS (open-source GIS with viewer), Global Mapper (commercial), SRTM Viewer utilities, and some web-based DEM viewers.
- Lightweight desktop options: QGIS (recommended for most beginners), GDAL command-line tools for conversions, and small utilities like TerrainView.
- Web-based: Online DEM viewers or terrain visualizers let you drag-and-drop HGT files for rapid inspection.
QGIS is the most beginner-friendly choice that combines a GUI, direct HGT support, and numerous analysis tools without cost.
Install and prepare (example: QGIS)
- Download and install QGIS from the official site (choose the latest stable release for your OS).
- Optional: install GDAL if you plan to use command-line tools; QGIS bundles GDAL, so separate installation isn’t required for basic use.
- Collect your HGT files in a known folder. HGT tiles should be uncompressed (plain .hgt files) or inside .zip/.tar archives—QGIS can open zipped HGTs directly in many cases.
Step-by-step: Opening an HGT file in QGIS
- Launch QGIS.
- From the menu, choose Layer → Add Layer → Add Raster Layer.
- Click “…” to browse to your HGT file (or the .zip that contains it) and then click Add.
- The HGT raster will appear as a grayscale hillshade-like image by default.
- Right-click the layer → Properties → Information to confirm metadata (grid size, CRS, data type). HGT files are in geographic coordinates using the WGS84 ellipsoid (EPSG:4326).
Basic visualization techniques
- Change the renderer: In layer Properties → Symbology, switch from “Singleband gray” to “Singleband pseudocolor” to map elevation to a color ramp (e.g., blues for low, browns for high).
- Stretching and contrast: Apply min/max values or use “Cumulative count cut” to remove outlier heights for better contrast.
- Hillshade for relief: Use the Hillshade tool (Raster → Analysis → Hillshade or Raster → Terrain Analysis plugin) to create shaded-relief from the DEM for a more natural look.
- Slope and aspect: Use Raster → Terrain Analysis → Slope / Aspect to produce derived rasters useful for landform analysis or planning.
Exporting and converting HGT files
- Convert to GeoTIFF: Right-click the layer → Export → Save As → choose GeoTIFF for broader compatibility and to preserve georeferencing.
- Resampling or reprojecting: In Save As, choose a target CRS (often EPSG:3857 or local UTM) and specify a new resolution if needed.
- Clip tiles: Use Raster → Extraction → Clip Raster by Extent or by Mask Layer to extract a smaller area from the HGT tile.
Common beginner workflows
- Quick inspection:
- Open the HGT in QGIS, apply a pseudocolor ramp, and generate a small hillshade to visually inspect terrain.
- Combine multiple tiles:
- Use Raster → Miscellaneous → Merge to stitch adjacent HGT tiles into one continuous DEM for larger-area analysis.
- Create contour lines:
- Use Raster → Extraction → Contour to generate vector contour lines from the DEM (set appropriate contour interval).
- Basic terrain analysis:
- Generate slope, aspect, viewshed, and watershed rasters using QGIS terrain tools or GRASS processing tools available within QGIS.
- Export for 3D:
- Save as GeoTIFF and import into 3D tools (Cesium, Blender with DEM import plugins, Google Earth Pro via KML/imagery overlays).
Troubleshooting common issues
- Blank or black image: Check Data Type and min/max values; apply stretching or set NoData handling. Ensure file is not corrupted.
- Wrong location/offsets: Confirm the file is georeferenced in EPSG:4326. If importing into a project with a different CRS, enable “on-the-fly” reprojection or reproject the raster.
- Voids (-32768 values): Use fill/interpolation tools (GDAL’s fillnodata or QGIS Raster → Analysis → Fill nodata) to estimate missing values.
- Large file / slow rendering: Tile or resample for faster display; build pyramids (right-click layer → Properties → Pyramids) to speed zooming and pan.
Quick GDAL tips (for command-line users)
- Inspect metadata:
gdalinfo N37W122.hgt
- Convert to GeoTIFF:
gdal_translate -of GTiff N37W122.hgt N37W122.tif
- Merge multiple HGTs:
gdal_merge.py -o merged.tif *.hgt
- Fill nodata:
gdal_fillnodata.py -md 1000 -of GTiff input.tif output_filled.tif
Best practices
- Keep raw HGT tiles unmodified; create copies when processing.
- Work in a projected CRS (e.g., UTM) for area/length calculations, but keep original DEMs in WGS84 for compatibility when combining tiles.
- Record metadata: tile name, source, resolution (1” or 3”), and any processing applied.
- For repeated work, automate using GDAL scripts or QGIS models to save time and ensure reproducibility.
Further learning and next steps
- Explore QGIS processing toolbox and GRASS/SAGA tools for advanced terrain analysis.
- Learn basic GDAL commands for batch processing.
- Try visualizing DEMs in 3D: QGIS 3D map view, Cesium, or Blender with heightmap plugins.
This guide should get you from opening an HGT file to performing basic visualization, analysis, and exports. If you’d like, tell me your operating system and whether you prefer GUI or command-line tools, and I’ll give a tailored step-by-step with exact menu paths or commands.
Leave a Reply