DLA Ganos provides built-in GeoTools data drivers. All the storage systems (such as PostGIS and GeoMesa) that are compatible with the GeoTools data access interface can be used as vector data sources of DLA Ganos. This topic describes how to use DLA Ganos to load data from a storage system that is compatible with the GeoTools data access interface.

Procedure

  1. Initialize a Spark session.
    // Initialize a Spark session.
    val spark = SparkSession.builder
          .appName("Simple Application")
          .config("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
          .config("spark.sql.crossJoin.enabled", "true")
          .config("spark.kryo.registrator", classOf[GanosSparkKryoRegistrator].getName)
          .getOrCreate()
    
    // Specify HBase connection parameters. The catalog name is set to POINT.
    val params = Map(
          "hbase.catalog" -> "POINT",
          "hbase.zookeepers" -> "The ZooKeeper address that is used to connect to HBase",
          "geotools" -> "true")
    
    // Load the automatic identification system (AIS) dataset.
    val dataFrame = spark.read
          .format("ganos-geometry")
          .options(params)
          .option("ganos.feature", "AIS")
          .load()
    
    dataFrame.show
  2. View the results.