package com.onthegomap.planetiler.custommap; import static com.onthegomap.planetiler.TestUtils.assertContains; import static com.onthegomap.planetiler.custommap.util.VerifyMonaco.MONACO_BOUNDS; import static com.onthegomap.planetiler.util.Gzip.gunzip; import static org.junit.jupiter.api.Assertions.assertEquals; import com.onthegomap.planetiler.TestUtils; import com.onthegomap.planetiler.VectorTile; import com.onthegomap.planetiler.custommap.util.TestConfigurableUtils; import com.onthegomap.planetiler.mbtiles.Mbtiles; import java.io.IOException; import java.nio.file.Path; import java.util.Map; import java.util.Set; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.Polygon; /** * End-to-end tests for custommap generation. *
* Generates an entire map for the smallest openstreetmap extract available (Monaco) and asserts that expected output
* features exist
*/
class ConfiguredMapTest {
@TempDir
static Path tmpDir;
private static Mbtiles mbtiles;
@BeforeAll
public static void runPlanetiler() throws Exception {
Path dbPath = tmpDir.resolve("output.mbtiles");
ConfiguredMapMain.main(
"generate-custom",
// Use local data extracts instead of downloading
"--schema=" + TestConfigurableUtils.pathToSample("owg_simple.yml"),
"--osm_path=" + TestUtils.pathToResource("monaco-latest.osm.pbf"),
"--water_polygons_path=" + TestUtils.pathToResource("water-polygons-split-3857.zip"),
// Override temp dir location
"--tmp=" + tmpDir,
// Override output location
"--output=" + dbPath
);
mbtiles = Mbtiles.newReadOnlyDatabase(dbPath);
}
@AfterAll
public static void close() throws IOException {
mbtiles.close();
}
@Test
void testMetadata() {
Map