package de.arxsilex.maptools.converter.core

enum class InputFormat(
    val displayName: String,
    val extensions: List<String>,
) {
    OSM_PBF("OpenStreetMap PBF", listOf(".osm.pbf", ".pbf")),
    MAPSFORGE_MAP("Mapsforge-Karte", listOf(".map")),
    MAPSFORGE_POI("Mapsforge-POI-Datenbank", listOf(".poi")),
    ELEVATION_HGT("SRTM-Höhendaten", listOf(".hgt")),
    ELEVATION_GEOTIFF("DEM GeoTIFF", listOf(".geotiff", ".tiff", ".tif")),
    ELEVATION_ASC("ESRI ASCII Grid", listOf(".asc")),
    ELEVATION_DTED("DTED-Höhendaten", listOf(".dt0", ".dt1", ".dt2")),
    OSM_XML("OpenStreetMap XML", listOf(".osm", ".xml")),
    OSM_XML_GZIP("Komprimiertes OSM XML (GZip)", listOf(".osm.gz")),
    OSM_XML_BZIP2("Komprimiertes OSM XML (BZip2)", listOf(".osm.bz2")),

    ;

    val isMapData: Boolean
        get() = this == OSM_PBF || this == MAPSFORGE_MAP

    val isPoiData: Boolean
        get() = this == MAPSFORGE_POI

    val isElevationData: Boolean
        get() = this in ELEVATION_FORMATS

    companion object {
        private val ELEVATION_FORMATS = setOf(
            ELEVATION_HGT,
            ELEVATION_GEOTIFF,
            ELEVATION_ASC,
            ELEVATION_DTED,
        )
    }
}
