Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pyhgtmap/output/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ def make_osm_filename(
for srcName in input_files_names
]
for srcNameMiddle in set(srcNameMiddles):
if srcNameMiddle.lower()[:5] in ALL_SUPPORTED_SOURCES:
continue
elif not opts.dataSources:
if not opts.dataSources:
# files from the command line, this could be something custom
srcTag = ",".join(set(srcNameMiddles))
# osmName = hgt.makeBBoxString(borders).format(prefix) + "_{0:s}.osm".format(srcTag)
osmName = hgt.makeBBoxString(borders).format(prefix) + "_local-source.osm"
break
elif srcNameMiddle.lower()[:5] in ALL_SUPPORTED_SOURCES:
continue
else:
osmName = hgt.makeBBoxString(borders).format(prefix) + ".osm"
break
Expand Down
8 changes: 8 additions & 0 deletions tests/test_output_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,11 @@ def test_make_osm_filename_gzip_level_variations(

assert result1 == result2
assert result1 == "lon0.00_1.00lat0.00_1.00_local-source.osm.gz"

@staticmethod
def test_make_osm_filename_no_data_sources(sample_bbox, default_config) -> None:
"""Test that function handles no dataSources with valid input files, matching usual data source patterns."""
default_config.dataSources = []
input_files = ["hgt/SRTM3/N00E000.hgt"]
result = make_osm_filename(sample_bbox, default_config, input_files)
assert result == "lon0.00_1.00lat0.00_1.00_local-source.osm"
Loading