Package org.h2gis.functions.io.kml

# Class KMLGeometry

java.lang.Object
org.h2gis.functions.io.kml.KMLGeometry

public class KMLGeometry extends Object
Tools to convert JTS geometry to KML representation

Author:
  Erwan Bocher

## Method Summary

Modifier and Type
Method
Description
`static void`
`appendKMLCoordinates(org.locationtech.jts.geom.Coordinate[] coords, StringBuilder sb)`
Build a string represention to kml coordinates Syntax : `<coordinates>...</coordinates> <!-- lon,lat[,alt] tuples -->`
`static void`
`toKMLGeometry(org.locationtech.jts.geom.Geometry geom, StringBuilder sb)`
Convert JTS geometry to a kml geometry representation.
`static void`
`toKMLGeometry(org.locationtech.jts.geom.Geometry geometry, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb)`
Convert JTS geometry to a kml geometry representation.
`static void`
`toKMLLinearRing(org.locationtech.jts.geom.LineString lineString, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb)`
Defines a closed line string, typically the outer boundary of a Polygon.
`static void`
`toKMLLineString(org.locationtech.jts.geom.LineString lineString, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb)`
Defines a connected set of line segments.
`static void`
`toKMLMultiGeometry(org.locationtech.jts.geom.GeometryCollection gc, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb)`
A container for zero or more geometry primitives associated with the same feature.
`static void`
`toKMLPoint(org.locationtech.jts.geom.Point point, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb)`
A geographic location defined by longitude, latitude, and (optional) altitude.
`static void`
`toKMLPolygon(org.locationtech.jts.geom.Polygon polygon, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb)`
A Polygon is defined by an outer boundary and 0 or more inner boundaries.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### toKMLGeometry

public static void toKMLGeometry(org.locationtech.jts.geom.Geometry geom, StringBuilder sb) throws SQLException
Convert JTS geometry to a kml geometry representation.

Parameters:
  `geom` -
  `sb` -
Throws:
  `SQLException`

### toKMLGeometry

public static void toKMLGeometry(org.locationtech.jts.geom.Geometry geometry, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb) throws SQLException
Convert JTS geometry to a kml geometry representation.

Parameters:
  `geometry` -
  `extrude` -
  `altitudeModeEnum` -
  `sb` -
Throws:
  `SQLException`

### toKMLPoint

public static void toKMLPoint(org.locationtech.jts.geom.Point point, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb)
A geographic location defined by longitude, latitude, and (optional) altitude. Syntax : `<Point id="ID"> <!-- specific to Point --> <extrude>0</extrude> <!-- boolean --> <altitudeMode>clampToGround</altitudeMode> <!-- kml:altitudeModeEnum: clampToGround, relativeToGround, or absolute --> <!-- or, substitute gx:altitudeMode: clampToSeaFloor, relativeToSeaFloor --> <coordinates>...</coordinates> <!-- lon,lat[,alt] --> </Point>` Supported syntax : `<Point> <extrude>0</extrude> <altitudeMode>clampToGround</altitudeMode> <coordinates>...</coordinates> <!-- lon,lat[,alt] --> </Point>`

Parameters:
  `point` -
  `extrude` -
  `altitudeModeEnum` -

### toKMLLineString

public static void toKMLLineString(org.locationtech.jts.geom.LineString lineString, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb)
Defines a connected set of line segments. Syntax : `<LineString id="ID"> <!-- specific to LineString --> <gx:altitudeOffset>0</gx:altitudeOffset> <!-- double --> <extrude>0</extrude> <!-- boolean --> <tessellate>0</tessellate> <!-- boolean --> <altitudeMode>clampToGround</altitudeMode> <!-- kml:altitudeModeEnum: clampToGround, relativeToGround, or absolute --> <!-- or, substitute gx:altitudeMode: clampToSeaFloor, relativeToSeaFloor --> <gx:drawOrder>0</gx:drawOrder> <!-- integer --> <coordinates>...</coordinates> <!-- lon,lat[,alt] --> </LineString>` Supported syntax : `<LineString> <extrude>0</extrude> <altitudeMode>clampToGround</altitudeMode> <coordinates>...</coordinates> <!-- lon,lat[,alt] --> </LineString>`

Parameters:
  `lineString` -

### toKMLLinearRing

public static void toKMLLinearRing(org.locationtech.jts.geom.LineString lineString, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb)
Defines a closed line string, typically the outer boundary of a Polygon. Syntax : `<LinearRing id="ID"> <!-- specific to LinearRing --> <gx:altitudeOffset>0</gx:altitudeOffset> <!-- double --> <extrude>0</extrude> <!-- boolean --> <tessellate>0</tessellate> <!-- boolean --> <altitudeMode>clampToGround</altitudeMode> <!-- kml:altitudeModeEnum: clampToGround, relativeToGround, or absolute --> <!-- or, substitute gx:altitudeMode: clampToSeaFloor, relativeToSeaFloor --> <coordinates>...</coordinates> <!-- lon,lat[,alt] tuples --> </LinearRing>` Supported syntax : `<LinearRing> <extrude>0</extrude> <altitudeMode>clampToGround</altitudeMode> <coordinates>...</coordinates> <!-- lon,lat[,alt] --> </LinearRing>`

Parameters:
  `lineString` -

### toKMLPolygon

public static void toKMLPolygon(org.locationtech.jts.geom.Polygon polygon, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb)
A Polygon is defined by an outer boundary and 0 or more inner boundaries. The boundaries, in turn, are defined by LinearRings. Syntax : `<Polygon id="ID"> <!-- specific to Polygon --> <extrude>0</extrude> <!-- boolean --> <tessellate>0</tessellate> <!-- boolean --> <altitudeMode>clampToGround</altitudeMode> <!-- kml:altitudeModeEnum: clampToGround, relativeToGround, or absolute --> <!-- or, substitute gx:altitudeMode: clampToSeaFloor, relativeToSeaFloor --> <outerBoundaryIs> <LinearRing> <coordinates>...</coordinates> <!-- lon,lat[,alt] --> </LinearRing> </outerBoundaryIs> <innerBoundaryIs> <LinearRing> <coordinates>...</coordinates> <!-- lon,lat[,alt] --> </LinearRing> </innerBoundaryIs> </Polygon>` Supported syntax : `<Polygon> <extrude>0</extrude> <altitudeMode>clampToGround</altitudeMode> <outerBoundaryIs> <LinearRing> <coordinates>...</coordinates> <!-- lon,lat[,alt] --> </LinearRing> </outerBoundaryIs> <innerBoundaryIs> <LinearRing> <coordinates>...</coordinates> <!-- lon,lat[,alt] --> </LinearRing> </innerBoundaryIs> </Polygon>`

Parameters:
  `polygon` -

### toKMLMultiGeometry

public static void toKMLMultiGeometry(org.locationtech.jts.geom.GeometryCollection gc, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb)
A container for zero or more geometry primitives associated with the same feature. `<MultiGeometry id="ID"> <!-- specific to MultiGeometry --> <!-- 0 or more Geometry elements --> </MultiGeometry>`

Parameters:
  `gc` -

### appendKMLCoordinates

public static void appendKMLCoordinates(org.locationtech.jts.geom.Coordinate[] coords, StringBuilder sb)
Build a string represention to kml coordinates Syntax : `<coordinates>...</coordinates> <!-- lon,lat[,alt] tuples -->`

Parameters:
  `coords` -