1

I'm currently struggling on trying to combine several .hgt files with different software. I can get the 4 tiles into any kind of software but my issue is exporting the file back to .hgt file.

I've tried using VTBuilder, which allowed me to easily blend the 4 tiles together. I made sure the projection was indeed to WGS 84 and the column and rows were at 1201 as a SRTM should be (as I have got 4 together perhaps I should have double them to 2402x2402?).

I then exported the data as .bt file from VTBuilder and imported it into Landserf, having seen information that it could write .hgt, which doesn't seem to be the case. I supposedly found a workaround by saving the file as a .bil and changing the file name manually to .hgt... It doesn't work as it should.

To give you all the context, I am working with grasshopper using the plugin elk. The grasshopper component cannot read 4x .hgt files and is asking for only one file larger than the area I am looking at ( which is 24.6420 to 25.1627; 94.8683 to 95.2968) hence why I am trying to combine them all together. I have access to QGIS and the software mentioned before.

I cannot seem to find anybody that has raised this issue before on the forum or online for that matter.

1

(Perhaps grasshopper/elk also accepts IMG and GeoTiff formats, anyway...)

Not a QGIS answer; my choice is SAGA, currently version 7.

  1. Install and Start SAGA

Mosaicking

  1. Drag and drop your hgt files to SAGA window.
  2. In the Tools window, go to Grid > Tools and activate Mosaicking tool.
  3. Mosaicking window has an entry for input files, as >>Grids. Click [...] button and select all your grids. [Edit] Choose Nearest Neighbour for resampling method. Then click on [Apply] button and then [Execute]. You'll have newly merged raster (grid).

Export hgt

  1. Then export the new grid as hgt. In the Tools window, go to Import/Export > GDAL/OGR and activate Export Raster tool.
  2. [Edit] Choose newly created Grid System (usualy 2401x, 2401y for 2x2 mosaic), then select new grid in the >>Grid(s). Give a new filename in File (file extension should be .hgt. In the Format selection, choose ESRI.hdr Labelled as the output format. Then click on [Apply] button and then [Execute] button. Now you have merged hgt file.

In this export process, SAGA is using a GDAL driver for ESRI BIL format. This is sometimes tricky (depends on data), but would work in most cases.

  • Thanks for your answer back Kazuhito! I've managed to create the "newly merged raster (grid)", teh software displayed "tool execution succeeded" but when I go to the next step which is exporting the raster the tool does not find the newly created grid for some reason. Do I need to select something first? Another odd thing is that the window is not displaying any information so i have no way to know if what I am doing is right. – Tom Feb 9 at 11:20
  • @Tom Sorry I forgot to describe the first step in the Export Raster tool, which is choosing the Grid system (at the top). There you find new grid system, perhaps 2401x, 2401y in size (merged and enlarged). Please select it. My apologies. – Kazuhito Feb 9 at 11:30
  • No worries at all thanks so much for helping me out, I really appreciate it. So I've gone through the steps you explained and it makes perfect sense apart for the "File" Part. When I go into the file tipe it doesn't display .hgt as a format so I just selected "All Files" and just added .hgt to the file name I wanted to write. It wrote teh file perfectly and the file size seemes consitent with addeing teh 4 files together roughly 4x 2.8mb with seems logical. the files is still not read in grasshopper thought so could it be due to me not finding the .hgt extension in naming the file? – Tom Feb 9 at 11:46
  • The fact that my files does not read could also be due to an issue with grasshopper now... – Tom Feb 9 at 11:49
  • @Tom Yes, you are right about selecting "All Files" and just naming it with .hgt extension. – Kazuhito Feb 9 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.