2121import com .protomaps .basemap .postprocess .Clip ;
2222import com .protomaps .basemap .text .FontRegistry ;
2323import java .io .IOException ;
24+ import java .nio .file .Files ;
2425import java .nio .file .Path ;
2526import java .nio .file .Paths ;
2627import java .util .HashMap ;
@@ -132,7 +133,7 @@ public String description() {
132133
133134 @ Override
134135 public String version () {
135- return "4.14.0 " ;
136+ return "4.14.1 " ;
136137 }
137138
138139 @ Override
@@ -257,9 +258,6 @@ static void run(Arguments args) throws IOException {
257258 Path dataDir = Path .of ("data" );
258259 Path sourcesDir = dataDir .resolve ("sources" );
259260
260- Path nePath = sourcesDir .resolve ("natural_earth_vector.sqlite.zip" );
261- String neUrl = "https://naciscdn.org/naturalearth/packages/natural_earth_vector.sqlite.zip" ;
262-
263261 var countryCoder = CountryCoder .fromJarResource ();
264262
265263 String area = args .getString ("area" , "Geofabrik area name to download, or filename in data/sources/" , "" );
@@ -285,7 +283,8 @@ static void run(Arguments args) throws IOException {
285283 }
286284
287285 var planetiler = Planetiler .create (args )
288- .addNaturalEarthSource ("ne" , nePath , neUrl );
286+ .addNaturalEarthSource ("ne" , sourcesDir .resolve ("natural_earth_vector.sqlite.zip" ),
287+ "https://naciscdn.org/naturalearth/packages/natural_earth_vector.sqlite.zip" );
289288
290289 if (!overtureFile .isEmpty ()) {
291290 // Add Overture Parquet source
@@ -309,12 +308,21 @@ static void run(Arguments args) throws IOException {
309308
310309 Path pgfEncodingZip = sourcesDir .resolve ("pgf-encoding.zip" );
311310 Path qrankCsv = sourcesDir .resolve ("qrank.csv.gz" );
312- Downloader .create (planetiler .config ()).add ("ne" , neUrl , nePath )
313- .add ("pgf-encoding" , "https://wipfli.github.io/pgf-encoding/pgf-encoding.zip" , pgfEncodingZip )
314- .add ("qrank" , "https://qrank.toolforge.org/download/qrank.csv.gz" , qrankCsv )
315- .run ();
311+
312+ if (!Files .exists (qrankCsv )) {
313+ Downloader .create (planetiler .config ())
314+ .add ("qrank" , "https://qrank.toolforge.org/download/qrank.csv.gz" , qrankCsv )
315+ .run ();
316+ }
317+
316318 var qrankDb = QrankDb .fromCsv (qrankCsv );
317319
320+ if (!Files .exists (pgfEncodingZip )) {
321+ Downloader .create (planetiler .config ())
322+ .add ("pgf-encoding" , "https://wipfli.github.io/pgf-encoding/pgf-encoding.zip" , pgfEncodingZip )
323+ .run ();
324+ }
325+
318326 FontRegistry fontRegistry = FontRegistry .getInstance ();
319327 fontRegistry .setZipFilePath (pgfEncodingZip .toString ());
320328
0 commit comments