All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.earth.worldwind.ogc.wmts.WmtsCapabilities.kt Maven / Gradle / Ivy

Go to download

The WorldWind Kotlin SDK (WWK) includes the library, examples and tutorials for building multiplatform 3D virtual globe applications for Android, Web and Java.

The newest version!
package earth.worldwind.ogc.wmts

import kotlinx.serialization.Serializable
import nl.adaptivity.xmlutil.serialization.XmlChildrenName
import nl.adaptivity.xmlutil.serialization.XmlSerialName

@Serializable
@XmlSerialName("Capabilities", WMTS10_NAMESPACE, WMTS10_PREFIX)
data class WmtsCapabilities(
    val version: String,
    val updateSequence: String? = null,
    val serviceIdentification: OwsServiceIdentification? = null,
    val serviceProvider: OwsServiceProvider? = null,
    val operationsMetadata: OwsOperationsMetadata? = null,
    val contents: WmtsContents,
    @XmlSerialName("Themes", WMTS10_NAMESPACE, WMTS10_PREFIX)
    @XmlChildrenName("Theme", WMTS10_NAMESPACE, WMTS10_PREFIX)
    val themes: List = emptyList(),
    @XmlSerialName("ServiceMetadataURL", WMTS10_NAMESPACE, WMTS10_PREFIX)
    val serviceMetadataUrls: List = emptyList()
) {
    val layers get() = contents.layers
    val tileMatrixSets get() = contents.tileMatrixSets

    init {
        layers.forEach { layer -> layer.capabilities = this }
    }

    fun getLayer(identifier: String) = contents.layers.firstOrNull { layer -> layer.identifier == identifier }

    fun getTileMatrixSet(identifier: String) = contents.tileMatrixSets.firstOrNull { tms -> tms.identifier == identifier }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy