ArcGIS Server Geoportal extension
10

com.esri.gpt.framework.ogc
Class KmlUtil

java.lang.Object
  extended by com.esri.gpt.framework.ogc.KmlUtil

public class KmlUtil
extends Object

KML/KMZ utility class.


Constructor Summary
KmlUtil()
           
 
Method Summary
static InputStream convertToFeaturesStream(InputStream kmlInputStream)
          Deprecated. since 10.0; use convertToFeaturesStream(java.io.InputStream, java.lang.String) instead.
static InputStream convertToFeaturesStream(InputStream kmlInputStream, String rootUrl)
          Drills-down KML stream for "Placemark" and follows "NetworkLink".
static InputStream extractKmlStream(InputStream kmzInputStream)
          Gets KML input stream from KMZ stream.
static InputStream openKmlStream(String url)
          Creates a stream from the URL possibly referencing KML/KMZ.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KmlUtil

public KmlUtil()
Method Detail

openKmlStream

public static InputStream openKmlStream(String url)
                                 throws IOException
Creates a stream from the URL possibly referencing KML/KMZ. If this is a KMZ, it will be interrogated for the enclosed KML, than that KML will be reopened.

Parameters:
url - KML/KMZ url
Throws:
IOException - if creating stream failed

extractKmlStream

public static InputStream extractKmlStream(InputStream kmzInputStream)
                                    throws IOException
Gets KML input stream from KMZ stream.

Parameters:
kmzInputStream - KMZ stream
Returns:
encoded input stream containing KML data
Throws:
IOException - extracting KML stream fails

convertToFeaturesStream

public static InputStream convertToFeaturesStream(InputStream kmlInputStream,
                                                  String rootUrl)
                                           throws IOException
Drills-down KML stream for "Placemark" and follows "NetworkLink". THis method ALWAYS closes input stream passed as an argument.

Parameters:
kmlInputStream - KML input stream
rootUrl - root URL used when KML contains relative URL
Returns:
first found feature stream.
Throws:
IOException - if convertiong stream fails

convertToFeaturesStream

@Deprecated
public static InputStream convertToFeaturesStream(InputStream kmlInputStream)
                                           throws IOException
Deprecated. since 10.0; use convertToFeaturesStream(java.io.InputStream, java.lang.String) instead.

Drills-down KML stream for "Placemark" and follows "NetworkLink". THis method ALWAYS closes input stream passed as an argument.

Parameters:
kmlInputStream - KML input stream
Returns:
first found feature stream.
Throws:
IOException - if convertiong stream fails

ArcGIS Server Geoportal extension
10

Copyright 2010 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.