| java.io.OutputStreamWriter org.vfny.geoserver.wms.responses.map.kml.KMLWriter
KMLWriter | public class KMLWriter extends OutputStreamWriter (Code) | | Writer for KML/KMZ (Keyhole Markup Language) files. Normaly controled by an
EncodeKML instance, this class handles the styling information and ensures
that the geometries produced match the pseudo GML expected by GE.
author: James Macgill author: $Author: Alessio Fabiani (alessio.fabiani@gmail.com) $ author: $Author: Simone Giannecchini (simboss1@gmail.com) $ author: Brent OwensKMLTransformer |
Method Summary | |
public void | endDocument() | public void | endFolder() | public Geometry | getCentroid(Geometry g) | public int | getMaximunFractionDigits() Gets the maximum number of digits allowed in the fraction portion of a
number. | public int | getMinimunFractionDigits() | protected static String | intToHex(int i) Utility method to convert an int into hex, padded to two characters. | protected boolean | isMultiPart(Geometry geom) | public void | newline() | public void | setMaximunFractionDigits(int numDigits) Sets the maximum number of digits allowed in the fraction portion of a
number. | public void | setMinimunFractionDigits(int numDigits) Sets the minimum number of digits allowed in the fraction portion of a
number. | public void | setRequestedScale(double scale) | public void | setSourceCrs(CoordinateReferenceSystem crs) | public void | startDocument(String name, String description) | public void | startFolder(String name, String description) Start a new KML folder. | public void | write(double d) | public void | writeCoverages(FeatureCollection features, MapLayer layer) | public void | writeFeaturesAsRaster(FeatureCollection features, MapLayer layer, int order) | public void | writeFeaturesAsVectors(FeatureCollection features, MapLayer layer) | protected void | writeGeometry(Geometry geom, GeometryTransformer trans) Write out the geometry. | protected void | writeLookAt(Geometry geom, GeometryTransformer trans) | protected void | writePlaceMarkPoint(Geometry geom, GeometryTransformer trans) |
KMLWriter | public KMLWriter(OutputStream out, WMSMapContext mapContext)(Code) | | Creates a new KMLWriter object.
Parameters: out - OutputStream to write the KML into Parameters: config - WMSMapContext describing the map to be generated. |
getCentroid | public Geometry getCentroid(Geometry g)(Code) | | Finds the centroid of the input geometry if input = point, line, polygon
--> return a point that represents the centroid of that geom if input =
geometry collection --> return a multipoint that represents the centoid
of each sub-geom
Parameters: g - |
getMinimunFractionDigits | public int getMinimunFractionDigits()(Code) | | |
intToHex | protected static String intToHex(int i)(Code) | | Utility method to convert an int into hex, padded to two characters.
handy for generating colour strings.
Parameters: i - Int to convert String a two character hex representation of i NOTE: this is autility method and should be put somewhere more useful. |
isMultiPart | protected boolean isMultiPart(Geometry geom)(Code) | | Test to see if the geometry is a Multi geometry
true if geom instance of MultiPolygon, MultiPoint orMultiLineString |
setMaximunFractionDigits | public void setMaximunFractionDigits(int numDigits)(Code) | | Sets the maximum number of digits allowed in the fraction portion of a
number.
Parameters: numDigits - See Also: NumberFormat.setMaximumFractionDigits |
setMinimunFractionDigits | public void setMinimunFractionDigits(int numDigits)(Code) | | Sets the minimum number of digits allowed in the fraction portion of a
number.
Parameters: numDigits - See Also: NumberFormat.setMinimumFractionDigits |
setRequestedScale | public void setRequestedScale(double scale)(Code) | | |
setSourceCrs | public void setSourceCrs(CoordinateReferenceSystem crs)(Code) | | |
startFolder | public void startFolder(String name, String description) throws IOException(Code) | | Start a new KML folder. From the spec 2.0: A top-level, optional tag used
to structure hierarchical arrangement of other folders, placemarks,
ground overlays, and screen overlays. Use this tag to structure and
organize your information in the Google Earth client.
In this context we should be using a Folder per map layer.
Parameters: name - A String to label this folder with, if null the name tag willbe ommited Parameters: description - Supplies descriptive information. This description appears inthe Places window when the user clicks on the folder or groundoverlay, and in a pop-up window when the user clicks on eitherthe Placemark name in the Places window, or the placemarkicon. The description element supports plain text as well asHTML formatting. A valid URL string for the World Wide Web isautomatically converted to a hyperlink to that URL (e.g.http://www.google.com). if null the description tag will beommited |
write | public void write(double d) throws IOException(Code) | | Formated version of standard write double
Parameters: d - The double to format and write out. throws: IOException - |
writeGeometry | protected void writeGeometry(Geometry geom, GeometryTransformer trans) throws IOException, TransformerException(Code) | | Write out the geometry. Contains workaround for the fact that KML2.0 does
not support multipart geometries in the same way that GML does.
Parameters: geom - The Geometry to be encoded, multi part geometries will bewritten as a sequence. Parameters: trans - A GeometryTransformer to produce the gml output, its output ispost processed to remove gml namespace prefixes. |
|
|