This topic describes how to use DLA Ganos to load raster data from PolarDB.


  1. Initialize a Spark session.
     val spark: SparkSession = {
        val session = SparkSession.builder
     // Load the Raster driver of DLA Ganos.
  2. Initialize connection parameters.
    val options = Map(
        "url" -> "jdbc:postgresql://",
        "user" -> "postgres",
        "password" -> "Ganos@2020",
        "dbtable" -> "gf",
        "numPartitions" -> "4")val options = Map(
        "url" -> "jdbc:postgresql://",
        "user" -> "postgres",
        "password" -> "Ganos@2020",
        "dbtable" -> "gf",
        "numPartitions" -> "4")
  3. Load the catalog table.
     val cat =
  4. View the results.

    The catalog table contains the IDs of layers and metadata, and supports spatio-temporal queries.

    • You can specify the ID and zoom to load a specific layer. The default value of z is 0, which indicates the lowest level of the pyramid.
      val layer =, zoom)
      Notice Multi-band images are automatically split into multiple single-band tiles for display.
    • You can also load multiple layers at the same time based on the collection of layer IDs.
      val layers =[id], zoom)