|
5 | 5 | import com.onthegomap.planetiler.config.Arguments;
|
6 | 6 | import com.onthegomap.planetiler.util.Downloader;
|
7 | 7 | import com.protomaps.basemap.feature.NaturalEarthDb;
|
| 8 | +import com.protomaps.basemap.feature.QrankDb; |
8 | 9 | import com.protomaps.basemap.layers.Boundaries;
|
9 | 10 | import com.protomaps.basemap.layers.Buildings;
|
10 | 11 | import com.protomaps.basemap.layers.Earth;
|
|
23 | 24 |
|
24 | 25 | public class Basemap extends ForwardingProfile {
|
25 | 26 |
|
26 |
| - public Basemap(Envelope earthWaterBounds, NaturalEarthDb naturalEarth) { |
| 27 | + public Basemap(Envelope earthWaterBounds, NaturalEarthDb naturalEarthDb, QrankDb qrankDb) { |
27 | 28 |
|
28 | 29 | var admin = new Boundaries();
|
29 | 30 | registerHandler(admin);
|
@@ -51,12 +52,12 @@ public Basemap(Envelope earthWaterBounds, NaturalEarthDb naturalEarth) {
|
51 | 52 | registerSourceHandler("osm", physicalPoint);
|
52 | 53 | registerSourceHandler("ne", physicalPoint::processNe);
|
53 | 54 |
|
54 |
| - var place = new Places(); |
| 55 | + var place = new Places(naturalEarthDb); |
55 | 56 | registerHandler(place);
|
56 | 57 | registerSourceHandler("osm", place);
|
57 | 58 | registerSourceHandler("ne", place::processNe);
|
58 | 59 |
|
59 |
| - var poi = new Pois(); |
| 60 | + var poi = new Pois(qrankDb); |
60 | 61 | registerHandler(poi);
|
61 | 62 | registerSourceHandler("osm", poi);
|
62 | 63 |
|
@@ -133,12 +134,14 @@ static void run(Arguments args) throws Exception {
|
133 | 134 | .addShapefileSource("osm_land", sourcesDir.resolve("land-polygons-split-3857.zip"),
|
134 | 135 | "https://osmdata.openstreetmap.de/download/land-polygons-split-3857.zip");
|
135 | 136 |
|
136 |
| - Downloader.create(planetiler.config(), planetiler.stats()).add("ne", neUrl, nePath).run(); |
| 137 | + Downloader.create(planetiler.config(), planetiler.stats()).add("ne", neUrl, nePath) |
| 138 | + .add("qrank", "https://qrank.wmcloud.org/download/qrank.csv.gz", sourcesDir.resolve("qrank.csv.gz")).run(); |
137 | 139 |
|
138 | 140 | var tmpDir = nePath.resolveSibling(nePath.getFileName() + "-unzipped");
|
139 | 141 | var naturalEarthDb = NaturalEarthDb.fromSqlite(nePath, tmpDir);
|
140 |
| - System.out.println(naturalEarthDb.getPopulatedPlaceByWikidataId("Q60")); |
| 142 | + var qrankDb = QrankDb.fromCsv(sourcesDir.resolve("qrank.csv.gz")); |
141 | 143 |
|
142 |
| - planetiler.setProfile(new Basemap(earthWaterBounds, naturalEarthDb)).setOutput(Path.of(area + ".pmtiles")).run(); |
| 144 | + planetiler.setProfile(new Basemap(earthWaterBounds, naturalEarthDb, qrankDb)).setOutput(Path.of(area + ".pmtiles")) |
| 145 | + .run(); |
143 | 146 | }
|
144 | 147 | }
|
0 commit comments