mibe / Srtm2Osm

Srtm2Osm tool uses Shuttle Radar Topography Mission (SRTM) digital elevation model (DEM) to generate elevation contours (isohypses) of a selected terrain. The tool writes contours as OSM ways into an OSM file. This then enables rendering of the terrain using Osmarender XSLT transformations or other OSM renderers.
https://wiki.openstreetmap.org/wiki/Srtm2Osm
13 stars 4 forks source link

Add new function to source files locally #15

Closed mibe closed 2 months ago

mibe commented 1 year ago

The source parameter does support the file scheme for local files, but it still needs the directory structure of the original SRTM server with the continents. So just throwing a bunch of .hgt files in a directory will not work.

This should be changed so that "throwing a bunch of .hgt files" will work. This is much easier for DEMs that are in SRTM format but not necessarily from the SRTM server, like in #13.

hgy59 commented 3 months ago

The source parameter does support the file scheme for local files, but it still needs the directory structure of the original SRTM server with the continents. So just throwing a bunch of .hgt files in a directory will not work.

You always can throw a bunch of .hgt files into the cache directory (folder SrtmCache in the cache folder specified with -d). The files in the source directory must be .hgt.zip files, not .hgt. If all required files are found in the cache, the source must not be known.

An additional parameter to ignore the Region structure could be implemented to make the source parameter more comfortable.

But another option to use specific file extensions should be added too. .hgt.zip is not the only extension used by different sources (but the name part is always [N|S]??[W|E]???) some use .zip (sonny) or the srtm1 files by nasa have .SRTMGL1.hgt.zip

mibe commented 3 months ago

That region enum is there because that was used in the directory structure on the original NASA server. Today the program could just index the server once and remember under which URL which files are available.

Heck, if the license question would be clear I would even host the hgt.zip files on my server wihtout any special structure.

Even the filename could be made variable, if the user could supply a template or regex. And in the last resort the program could also ask the user to select the file for the needed cell manually.

hgy59 commented 3 months ago

That region enum is there because that was used in the directory structure on the original NASA server. Today the program could just index the server once and remember under which URL which files are available.

The current default source (http://firmware.ardupilot.org/SRTM/) works with those regions.