From 6f0ac9f46c67beb4040b24101d1e82b7d1555cd6 Mon Sep 17 00:00:00 2001 From: Mike Barry Date: Fri, 27 Oct 2023 05:59:33 -0400 Subject: [PATCH] tweaks --- .../src/main/java/com/onthegomap/planetiler/VectorTile.java | 2 +- .../com/onthegomap/planetiler/collection/FeatureGroup.java | 6 +++--- .../java/com/onthegomap/planetiler/util/TileSizeStats.java | 2 +- .../com/onthegomap/planetiler/worker/WorkerPipeline.java | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/VectorTile.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/VectorTile.java index 6d15b14fd5..97964fb721 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/VectorTile.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/VectorTile.java @@ -516,7 +516,7 @@ public VectorTileProto.Tile toProto() { case Float floatValue -> tileValue.setFloatValue(floatValue); case Double doubleValue -> tileValue.setDoubleValue(doubleValue); case Boolean booleanValue -> tileValue.setBoolValue(booleanValue); - case Object ignored -> tileValue.setStringValue(value.toString()); + case Object other -> tileValue.setStringValue(other.toString()); } tileLayer.addValues(tileValue.build()); } diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/collection/FeatureGroup.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/collection/FeatureGroup.java index d7dcdcfe0b..be4162db80 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/collection/FeatureGroup.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/collection/FeatureGroup.java @@ -217,9 +217,9 @@ private byte[] encodeValue(VectorTile.Feature vectorTileFeature, RenderedFeature var attrs = vectorTileFeature.attrs(); packer.packMapHeader((int) attrs.values().stream().filter(Objects::nonNull).count()); for (Map.Entry entry : attrs.entrySet()) { - if (entry.getValue() != null) { + Object value = entry.getValue(); + if (value != null) { packer.packInt(commonValueStrings.encode(entry.getKey())); - Object value = entry.getValue(); packer.packValue(switch (value) { case String string -> ValueFactory.newString(string); case Integer integer -> ValueFactory.newInteger(integer.longValue()); @@ -227,7 +227,7 @@ private byte[] encodeValue(VectorTile.Feature vectorTileFeature, RenderedFeature case Float floatValue -> ValueFactory.newFloat(floatValue); case Double doubleValue -> ValueFactory.newFloat(doubleValue); case Boolean booleanValue -> ValueFactory.newBoolean(booleanValue); - default -> ValueFactory.newString(value.toString()); + case Object other -> ValueFactory.newString(other.toString()); }); } } diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/util/TileSizeStats.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/util/TileSizeStats.java index e196e07eee..cb3f6d8708 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/util/TileSizeStats.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/util/TileSizeStats.java @@ -44,7 +44,7 @@ * archive, or run the following an existing archive: * *
- * {@snippet lang="bash" :
+ * {@code
  * java -jar planetiler.jar stats --input= --output=layerstats.tsv.gz
  * }
  * 
diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/worker/WorkerPipeline.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/worker/WorkerPipeline.java index 506b2a2115..22abcacd80 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/worker/WorkerPipeline.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/worker/WorkerPipeline.java @@ -17,7 +17,6 @@ * A mini-framework for chaining sequential steps that run in dedicated threads with a queue between each. *

* For example: - * * {@snippet : * WorkerPipeline.start("name", stats) * .readFrom("reader", List.of(1, 2, 3))