diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/Profile.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/Profile.java index 99a2db7ee1..3a2a517b01 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/Profile.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/Profile.java @@ -158,7 +158,7 @@ default boolean isOverlay() { return false; } - default Map extraMetadata() { return Map.of(); } + default Map extraArchiveMetadata() { return Map.of(); } /** * Defines whether {@link Wikidata} should fetch wikidata translations for the input element. diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/archive/TileArchiveMetadata.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/archive/TileArchiveMetadata.java index 81749e0e01..8ee489c9c6 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/archive/TileArchiveMetadata.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/archive/TileArchiveMetadata.java @@ -17,6 +17,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.TreeMap; import java.util.stream.Collectors; import java.util.stream.Stream; import org.locationtech.jts.geom.Coordinate; @@ -95,7 +96,7 @@ public TileArchiveMetadata(Profile profile, PlanetilerConfig config, List mergeMaps(Map m1, Map m2) { - return Stream.concat(m1.entrySet().stream(), m2.entrySet().stream()) - .collect(Collectors.toMap( - Map.Entry::getKey, - Map.Entry::getValue, - (value1, value2) -> value2)); + var result = new TreeMap<>(m1); + result.putAll(m2); + return result; } @JsonAnySetter diff --git a/planetiler-core/src/test/java/com/onthegomap/planetiler/archive/TileArchiveMetadataTest.java b/planetiler-core/src/test/java/com/onthegomap/planetiler/archive/TileArchiveMetadataTest.java index 7ba9e87dde..848cadc072 100644 --- a/planetiler-core/src/test/java/com/onthegomap/planetiler/archive/TileArchiveMetadataTest.java +++ b/planetiler-core/src/test/java/com/onthegomap/planetiler/archive/TileArchiveMetadataTest.java @@ -204,7 +204,7 @@ public String name() { } @Override - public Map extraMetadata() { + public Map extraArchiveMetadata() { return Map.of("FooVersion","2.0"); } }