I would like to know if there is how to load a kmz file, and then, to generate a kmldocument from this kmz file.
Hello,I believe you could be able to do this.sample code:
// load a KML dataset from a local KMZ file and show it as an operational layerKmlDataset kmlDataset = new KmlDataset(kmz_data_path);KmlLayer kmlLayer = new KmlLayer(kmlDataset);SceneView.getScene().getOperationalLayers().add(kmlLayer);
// listen for the KML dataset to finish loading// generate a kmldocument from this kmz filekmlDataset.addDoneLoadingListener(() -> {if (kmlDataset.getLoadStatus() == LoadStatus.LOADED) {List<KmlNode> nodes = mKmlDataset.getRootNodes();KmlNode rootNode = nodes.get(0);assertTrue("Expected the root node to be a KmlDocument", (rootNode instanceof KmlDocument));KmlDocument kmlDocument = (KmlDocument)rootNode;}
The sample assumes the root node in the KMZ is a KMLDocument node.
This suggestion works!!!
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.