Package org.h2gis.functions.io.kml
Class KMLWriterDriver
- java.lang.Object
-
- org.h2gis.functions.io.kml.KMLWriterDriver
-
public class KMLWriterDriver extends Object
KML writer- Author:
- Erwan Bocher
-
-
Constructor Summary
Constructors Constructor Description KMLWriterDriver(Connection connection, File fileName, String encoding, boolean deleteFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidwrite(String tableName, org.h2gis.api.ProgressVisitor progress)Write spatial table or sql query to kml or kmz file format.voidwriteExtendedData(XMLStreamWriter xmlOut, ResultSet rs)The ExtendedData element offers three techniques for adding custom data to a KML Feature (NetworkLink, Placemark, GroundOverlay, PhotoOverlay, ScreenOverlay, Document, Folder).voidwritePlacemark(XMLStreamWriter xmlOut, ResultSet rs, String geomField)A Placemark is a Feature with associated Geometry.Syntax :<Placemark id="ID"> <!-- inherited from Feature element --> <name>...</name> <!-- string --> <visibility>1</visibility> <!-- boolean --> <open>0</open> <!-- boolean --> <atom:author>...<atom:author> <!-- xmlns:atom --> <atom:link href=" "/> <!-- xmlns:atom --> <address>...</address> <!-- string --> <xal:AddressDetails>...</xal:AddressDetails> <!-- xmlns:xal --> <phoneNumber>...</phoneNumber> <!-- string --> <Snippet maxLines="2">...</Snippet> <!-- string --> <description>...</description> <!-- string --> <AbstractView>...</AbstractView> <!-- Camera or LookAt --> <TimePrimitive>...</TimePrimitive> <styleUrl>...</styleUrl> <!-- anyURI --> <StyleSelector>...</StyleSelector> <Region>...</Region> <Metadata>...</Metadata> <!-- deprecated in KML 2.2 --> <ExtendedData>...</ExtendedData> <!-- new in KML 2.2 --> <!-- specific to Placemark element --> <Geometry>...</Geometry> </Placemark>voidwriteSimpleData(XMLStreamWriter xmlOut, String columnName, String value)
-
-
-
Constructor Detail
-
KMLWriterDriver
public KMLWriterDriver(Connection connection, File fileName, String encoding, boolean deleteFile)
-
-
Method Detail
-
write
public void write(String tableName, org.h2gis.api.ProgressVisitor progress) throws SQLException, IOException
Write spatial table or sql query to kml or kmz file format.- Parameters:
tableName- the name of table or a select queryprogress- progress monitor- Throws:
SQLExceptionIOException
-
writePlacemark
public void writePlacemark(XMLStreamWriter xmlOut, ResultSet rs, String geomField) throws XMLStreamException, SQLException
A Placemark is a Feature with associated Geometry.Syntax :<Placemark id="ID"> <!-- inherited from Feature element --> <name>...</name> <!-- string --> <visibility>1</visibility> <!-- boolean --> <open>0</open> <!-- boolean --> <atom:author>...<atom:author> <!-- xmlns:atom --> <atom:link href=" "/> <!-- xmlns:atom --> <address>...</address> <!-- string --> <xal:AddressDetails>...</xal:AddressDetails> <!-- xmlns:xal --> <phoneNumber>...</phoneNumber> <!-- string --> <Snippet maxLines="2">...</Snippet> <!-- string --> <description>...</description> <!-- string --> <AbstractView>...</AbstractView> <!-- Camera or LookAt --> <TimePrimitive>...</TimePrimitive> <styleUrl>...</styleUrl> <!-- anyURI --> <StyleSelector>...</StyleSelector> <Region>...</Region> <Metadata>...</Metadata> <!-- deprecated in KML 2.2 --> <ExtendedData>...</ExtendedData> <!-- new in KML 2.2 --> <!-- specific to Placemark element --> <Geometry>...</Geometry> </Placemark>- Parameters:
xmlOut-rs-geomField-- Throws:
XMLStreamExceptionSQLException
-
writeExtendedData
public void writeExtendedData(XMLStreamWriter xmlOut, ResultSet rs) throws XMLStreamException, SQLException
The ExtendedData element offers three techniques for adding custom data to a KML Feature (NetworkLink, Placemark, GroundOverlay, PhotoOverlay, ScreenOverlay, Document, Folder). These techniques are Adding untyped data/value pairs using theDataelement (basic) Declaring new typed fields using theSchemaelement and then instancing them using the<SchemaData>element (advanced) Referring to XML elements defined in other namespaces by referencing the external namespace within the KML file (basic) These techniques can be combined within a single KML file or Feature for different pieces of data. Syntax :<ExtendedData> <Data name="string"> <displayName>...</displayName> <!-- string --> <value>...</value> <!-- string --> </Data> <SchemaData schemaUrl="anyURI"> <SimpleData name=""> ... </SimpleData> <!-- string --> </SchemaData> <namespace_prefix:other>...</namespace_prefix:other> </ExtendedData>- Parameters:
xmlOut-- Throws:
XMLStreamExceptionSQLException
-
writeSimpleData
public void writeSimpleData(XMLStreamWriter xmlOut, String columnName, String value) throws XMLStreamException
- Parameters:
xmlOut-- Throws:
XMLStreamException
-
-