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 fc0d4eca3b..a2928ea885 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 @@ -20,8 +20,6 @@ import java.util.TreeMap; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Envelope; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * Metadata associated with a tile archive. @@ -49,6 +47,7 @@ public record TileArchiveMetadata( @JsonSerialize(using = TileArchiveMetadataDeSer.MetadataJsonSerializer.class) @JsonDeserialize(using = TileArchiveMetadataDeSer.MetadataJsonDeserializer.class) TileArchiveMetadataJson json, @JsonAnyGetter + @JsonAnySetter @JsonDeserialize(using = TileArchiveMetadataDeSer.EmptyMapIfNullDeserializer.class) Map others, @JsonProperty(COMPRESSION_KEY) TileCompression tileCompression ) { @@ -71,8 +70,6 @@ public record TileArchiveMetadata( public static final String MVT_FORMAT = "pbf"; - private static final Logger LOGGER = LoggerFactory.getLogger(TileArchiveMetadata.class); - public TileArchiveMetadata(Profile profile, PlanetilerConfig config) { this(profile, config, null); } @@ -94,7 +91,7 @@ public TileArchiveMetadata(Profile profile, PlanetilerConfig config, List mergeMaps(Map m1, Map m2) { + private static Map mergeMaps(Map m1, Map m2) { var result = new TreeMap<>(m1); result.putAll(m2); return result; } - @JsonAnySetter - private void putUnknownFieldsToOthers(String name, String value) { - others.put(name, value); - } - public record TileArchiveMetadataJson( @JsonProperty(VECTOR_LAYERS_KEY) List vectorLayers diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/pmtiles/Pmtiles.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/pmtiles/Pmtiles.java index c175d9747d..bfe80bfa12 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/pmtiles/Pmtiles.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/pmtiles/Pmtiles.java @@ -363,7 +363,7 @@ public static List directoryFromBytes(byte[] bytes) { */ public record JsonMetadata( @JsonProperty("vector_layers") List vectorLayers, - @JsonAnyGetter Map otherMetadata + @JsonAnySetter @JsonAnyGetter Map otherMetadata ) { @JsonCreator @@ -371,11 +371,6 @@ public JsonMetadata(@JsonProperty("vector_layers") List()); } - @JsonAnySetter - private void setExtraMetadata(String key, String val) { - otherMetadata.put(key, val); - } - public byte[] toBytes() { try { diff --git a/pom.xml b/pom.xml index d14afd4cf7..dc9dc98cb0 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 21 21 true - 2.17.2 + 2.18.0 5.11.1 1.20.0 https://sonarcloud.io