Package com.googlecode.libkml

Examples of com.googlecode.libkml.KmlFactory


    }
  }

  public static void main(String[] args) {
    // NOTE: KmlFactory does _not_ use kmldom.
    KmlFactory factory = KmlFactory.GetFactory();

    // <coordinates>1,2</coordinates>
    Coordinates coordinates = factory.CreateCoordinates();
    coordinates.add_latlng(37.0, -122.0);

    // <Point id="pt0">...
    Point point = factory.CreatePoint();
    point.set_id("pt0");
    point.set_coordinates(coordinates);

    // <Placemark id="pm123"><name>my place</name>...
    Placemark placemark = factory.CreatePlacemark();
    placemark.set_name("my placemark");
    placemark.set_id("pm123");
    placemark.set_geometry(point);

    // <kml>...
    Kml kml = factory.CreateKml();
    kml.set_feature(placemark);

    // NOTE: this _requires_ kmldom.
    System.out.print(kmldom.SerializePretty(kml));
  }
View Full Code Here


      System.exit(1);
    }
  }

  public static void main(String[] args) throws InterruptedException {
    KmlFactory factory = KmlFactory.GetFactory();

    Folder folder = factory.CreateFolder();
    folder.set_name("foo");

    Placemark p0 = factory.CreatePlacemark();
    p0.set_name("placemark 0");
    p0.set_id("p0");

    folder.add_feature(p0);
View Full Code Here

TOP

Related Classes of com.googlecode.libkml.KmlFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.