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

com.scalakml.example.ReadExample2.scala Maven / Gradle / Ivy

The newest version!
package com.scalakml.example

import com.scalakml.io.{KmlPrintWriter, KmlFileReader}
import xml.PrettyPrinter
import com.scalakml.kml.{Point, Placemark}

/**
 * Author: Ringo Wathelet
 * Date: 23/01/13 
 * Version: 1
 */

object ReadExample2 {
  def main(args: Array[String]) {
    println("....ReadExample2 start...\n")
    // read a kml file into a kml root object
    val kml = new KmlFileReader().getKmlFromFile("./kml-files/Sydney-oz.kml")
    // get the placemark
    val placemark = kml.get.feature.get.asInstanceOf[Placemark]
    // get the placemark point
    val point = placemark.geometry.get.asInstanceOf[Point]
    // print the point coordinates
    println("coordinate: " + point.coordinates)

    println("\n....ReadExample2 done...")
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy