private static void configureSource(Planetiler planetiler, Path sourcesDir, Source source) {

    DataSourceType sourceType = source.type();
    Path localPath = source.localPath();
    String projection = source.projection();
    if (localPath == null) {
      if (source.url() == null) {
        throw new ParseException("Must provide either a url or path for " + source.id());
      }
      localPath = sourcesDir.resolve(source.defaultFileUrl());
    }

    switch (sourceType) {
      case OSM -> planetiler.addOsmSource(source.id(), localPath, source.url());
      case SHAPEFILE -> planetiler.addShapefileSource(projection, source.id(), localPath, source.url());
      case GEOPACKAGE -> planetiler.addGeoPackageSource(projection, source.id(), localPath, source.url());
      case GEOJSON -> planetiler.addGeoJsonSource(source.id(), localPath, source.url());
      default -> throw new IllegalArgumentException("Unhandled source type for " + source.id() + ": " + sourceType);
    }
  }
Main driver to create maps configured by a YAML file.
<p>
Parses the config file into a {@link ConfiguredProfile}, loads sources into {@link Planetiler} runner and kicks off
the map generation process.
planetiler-custommap/src/main/java/com/onthegomap/planetiler/custommap/ConfiguredMapMain.java