Package org.locationtech.jts.io.kml
Class KMLReader
- java.lang.Object
-
- org.locationtech.jts.io.kml.KMLReader
-
public class KMLReader extends java.lang.ObjectConstructs aGeometryobject from the OGC KML representation. Works only with KML geometry elements and may also parse attributes within these elements
-
-
Constructor Summary
Constructors Constructor Description KMLReader()Creates a reader that creates objects using the defaultGeometryFactory.KMLReader(java.util.Collection<java.lang.String> attributeNames)Creates a reader that creates objects using the defaultGeometryFactory.KMLReader(GeometryFactory geometryFactory)Creates a reader that creates objects using the givenGeometryFactory.KMLReader(GeometryFactory geometryFactory, java.util.Collection<java.lang.String> attributeNames)Creates a reader that creates objects using the givenGeometryFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Geometryread(java.lang.String kmlGeometryString)Reads a KML representation of aGeometryfrom aString.
-
-
-
Constructor Detail
-
KMLReader
public KMLReader()
Creates a reader that creates objects using the defaultGeometryFactory.
-
KMLReader
public KMLReader(GeometryFactory geometryFactory)
Creates a reader that creates objects using the givenGeometryFactory.- Parameters:
geometryFactory- the factory used to createGeometrys.
-
KMLReader
public KMLReader(java.util.Collection<java.lang.String> attributeNames)
Creates a reader that creates objects using the defaultGeometryFactory.- Parameters:
attributeNames- names of attributes that should be parsed (i.e. extrude, altitudeMode, tesselate, etc).
-
KMLReader
public KMLReader(GeometryFactory geometryFactory, java.util.Collection<java.lang.String> attributeNames)
Creates a reader that creates objects using the givenGeometryFactory.- Parameters:
geometryFactory- the factory used to createGeometrys.attributeNames- names of attributes that should be parsed (i.e. extrude, altitudeMode, tesselate, etc).
-
-
Method Detail
-
read
public Geometry read(java.lang.String kmlGeometryString) throws ParseException
Reads a KML representation of aGeometryfrom aString. If any attribute names were specified duringKMLReaderconstruction, they will be stored asMapinGeometry.setUserData(Object)- Parameters:
kmlGeometryString- string that specifies kml representation of geometry- Returns:
- a
Geometryspecified bykmlGeometryString - Throws:
ParseException- if a parsing problem occurs
-
-