public class KmlWriter extends WebFormatWriter<GeoShape>
Constructor and Description |
---|
KmlWriter()
Construct a KML writer without specifying an output writer
|
KmlWriter(java.io.Writer writer)
Construct a KML writer for the given output stream
|
Modifier and Type | Method and Description |
---|---|
void |
addGeoLayer(GeoLayer layer)
Add a Geographic Layer to the KML file.
|
void |
addShape(GeoShape shape)
Add a shape to the KML file.
|
void |
addTimedShape(GeoShape shape,
TimeSpan span)
Add a shape with a time component.
|
void |
clear()
Clear and reset the writer.
|
void |
close()
Close the KML file, writing the contents to the specified output stream.
|
protected org.w3c.dom.Element |
createDescription(DataRecord rec)
Create a description element.
|
java.lang.String |
getContentType()
Get the content type generated by this writer.
|
void |
writeData(java.util.Collection<GeoShape> data)
Write a collection of Geoshapes.
|
getDestination, getWriter, setDestination, setWriter
public KmlWriter()
public KmlWriter(java.io.Writer writer)
writer
- the writer where the KML file will be writtenpublic void addGeoLayer(GeoLayer layer)
layer
- The Geographic Layerpublic void addShape(GeoShape shape)
shape
- the shape to addpublic void addTimedShape(GeoShape shape, TimeSpan span)
shape
- the shape to addspan
- The timespan with time informationpublic void clear()
public void close()
protected org.w3c.dom.Element createDescription(DataRecord rec)
rec
- the data record used to create the descriptionpublic java.lang.String getContentType()
getContentType
in class WebFormatWriter<GeoShape>
application/vnd.google-earth.kml+xml
public void writeData(java.util.Collection<GeoShape> data)
data
- the collection of geographic shapes