public class CrsWktDecoder extends Object
CoordinateReferenceSystem
definitions in WKT.
The current implementation ensures that the postgis CRS WKT's are correctly interpreted. There are some minor differences with the OGC specification: "Coordinate Transformation Services (rev. 1.00)".
The implementation uses a recursive-decent parsing approach.
This class is not thread-safe.
Modifier and Type | Field and Description |
---|---|
protected WktToken |
currentToken |
Constructor and Description |
---|
CrsWktDecoder()
Initiates a new
CrsWktDecoder that uses the CrsWktVariant . |
Modifier and Type | Method and Description |
---|---|
CoordinateReferenceSystem |
decode(String wkt)
Decodes a WKT representation of a
CoordinateReferenceSystem . |
protected double |
decodeNumber()
Returns the value of the current token and moves to the next token if the current token matches a number.
|
protected String |
decodeText()
Returns the text and moves to the next token if the current token matches text, otherwise throws an exception.
|
protected int |
getTokenizerPosition()
Reports the current position of the tokenizer.
|
protected org.geolatte.geom.codec.WktVariant |
getWktVariant()
Returns the
WktVariant for this decoder. |
protected boolean |
matchesCloseList()
Returns true and moves to the next token if the current token matches the close list token.
|
protected boolean |
matchesElementSeparator()
Returns true and moves to the next token if the current token matches the element separator token.
|
protected boolean |
matchesOpenList()
Returns true and moves to the next token if the current token matches the open list token.
|
protected void |
nextToken()
Advances the decoding to the next token.
|
protected void |
setTokenizer(org.geolatte.geom.codec.AbstractWktTokenizer tokenizer) |
protected WktToken currentToken
public CrsWktDecoder()
CrsWktDecoder
that uses the CrsWktVariant
.public CoordinateReferenceSystem decode(String wkt)
CoordinateReferenceSystem
.wkt
- the WKT string to decodeCoordinateReferenceSystem
that is encoded in the input WKT.protected void setTokenizer(org.geolatte.geom.codec.AbstractWktTokenizer tokenizer)
protected String decodeText()
WktDecodeException
- when the current token does not match text.protected void nextToken()
protected boolean matchesOpenList()
protected boolean matchesCloseList()
protected boolean matchesElementSeparator()
protected double decodeNumber()
WktDecodeException
- if the current token does not match a number.protected org.geolatte.geom.codec.WktVariant getWktVariant()
WktVariant
for this decoder.WktVariant
for this decoder.protected int getTokenizerPosition()
Copyright © 2015 geolatte.org. All rights reserved.