diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/archive/TileArchiveWriter.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/archive/TileArchiveWriter.java index 9861cf54bd..8c3fc2bd48 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/archive/TileArchiveWriter.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/archive/TileArchiveWriter.java @@ -88,8 +88,8 @@ public static void writeOutput(FeatureGroup features, WriteableTileArchive outpu TileArchiveMetadata tileArchiveMetadata, Path layerStatsPath, PlanetilerConfig config, Stats stats) { var timer = stats.startStage("archive"); - int chunksToRead = Math.min(1, features.chunksToRead()); - int readThreads = Math.clamp(config.featureReadThreads(), 1, chunksToRead); + int chunksToRead = Math.max(1, features.chunksToRead()); + int readThreads = Math.min(config.featureReadThreads(), chunksToRead); int threads = config.threads(); int processThreads = threads < 10 ? threads : threads - readThreads; int tileWriteThreads = config.tileWriteThreads();