From 7a6bbf8c533011850dc06fae94c7e0487133582e Mon Sep 17 00:00:00 2001 From: Michael Barry Date: Thu, 3 Mar 2022 07:25:24 -0500 Subject: [PATCH] Warn when running with insufficient memory or disk space (#73) --- .../planetiler/basemap/BasemapProfile.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/com/onthegomap/planetiler/basemap/BasemapProfile.java b/src/main/java/com/onthegomap/planetiler/basemap/BasemapProfile.java index f5a8308..bcf1107 100644 --- a/src/main/java/com/onthegomap/planetiler/basemap/BasemapProfile.java +++ b/src/main/java/com/onthegomap/planetiler/basemap/BasemapProfile.java @@ -182,6 +182,24 @@ public class BasemapProfile extends ForwardingProfile { return OpenMapTilesSchema.VERSION; } + @Override + public long estimateIntermediateDiskBytes(long osmFileSize) { + // in late 2021, a 60gb OSM file used 200GB for intermediate storage + return osmFileSize * 200 / 60; + } + + @Override + public long estimateOutputBytes(long osmFileSize) { + // in late 2021, a 60gb OSM file generated a 100GB output file + return osmFileSize * 100 / 60; + } + + @Override + public long estimateRamRequired(long osmFileSize) { + // 30gb for a 60gb OSM file is generally safe, although less might be OK too + return osmFileSize / 2; + } + /** * Layers should implement this interface to subscribe to elements from natural * earth.