it.cutruzzula.lwkt
Class WKTParser

java.lang.Object
  extended by it.cutruzzula.lwkt.WKTParser

public class WKTParser
extends java.lang.Object

The core class of the LWKT parser


Method Summary
static AbstractGeometry parse(java.lang.String input)
          Method to parse a WKT string.
static java.lang.String parseToGML2(java.lang.String input)
          Method to parse a WKT string to get GML 2 output.
static java.lang.String parseToGML2(java.lang.String input, java.lang.String srsName)
          Method to parse a WKT string to get GML 2 output.
static java.lang.String parseToGML3(java.lang.String input)
          Method to parse a WKT string to get GML 3 output (for example MultiSurface instead of MultiPolygon).
static java.lang.String parseToGML3(java.lang.String input, java.lang.String srsName)
          Method to parse a WKT string to get GML 3 output (for example MultiSurface instead of MultiPolygon).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseToGML2

public static java.lang.String parseToGML2(java.lang.String input)
                                    throws java.lang.Exception
Method to parse a WKT string to get GML 2 output.

Parameters:
input - The WKT string
Returns:
The GML v2 content
Throws:
java.lang.Exception - A generic exception thrown in parsing

parseToGML2

public static java.lang.String parseToGML2(java.lang.String input,
                                           java.lang.String srsName)
                                    throws java.lang.Exception
Method to parse a WKT string to get GML 2 output.

Parameters:
input - The WKT string
srsName - The SRS to write in output GML
Returns:
The GML v2 content
Throws:
java.lang.Exception - A generic exception thrown in parsing

parseToGML3

public static java.lang.String parseToGML3(java.lang.String input)
                                    throws java.lang.Exception
Method to parse a WKT string to get GML 3 output (for example MultiSurface instead of MultiPolygon).

Parameters:
input - The WKT string
Returns:
The GML v3 content
Throws:
java.lang.Exception - A generic exception thrown in parsing

parseToGML3

public static java.lang.String parseToGML3(java.lang.String input,
                                           java.lang.String srsName)
                                    throws java.lang.Exception
Method to parse a WKT string to get GML 3 output (for example MultiSurface instead of MultiPolygon).

Parameters:
input - The WKT string
srsName - The SRS to write in output GML
Returns:
The GML v3 content
Throws:
java.lang.Exception - A generic exception thrown in parsing

parse

public static AbstractGeometry parse(java.lang.String input)
                              throws java.lang.Exception
Method to parse a WKT string.

Parameters:
input - The WKT string
Returns:
The An AbstractGeometry object (instance of Point, or MultiPoint, or LineString, or MultiLineString, or Polygon, or MultiPolygon)
Throws:
java.lang.Exception - A generic exception thrown in parsing