class WktTokenizer extends AbstractWktTokenizer
The variant of WKT that this tokenizer recognizes is determined by the WktVariant
that is passed upon construction.
| Modifier and Type | Field and Description |
|---|---|
protected CoordinateReferenceSystem<?> |
baseCRS |
protected boolean |
forceToCRS |
private boolean |
isMeasured |
private static long |
P_MAX |
private static long |
S_MAX |
private CoordinateReferenceSystem<?> |
targetCRS |
currentPos, variant, wkt| Modifier | Constructor and Description |
|---|---|
protected |
WktTokenizer(java.lang.CharSequence wkt,
WktVariant variant,
CoordinateReferenceSystem<?> baseCRS) |
protected |
WktTokenizer(java.lang.CharSequence wkt,
WktVariant variant,
CoordinateReferenceSystem<?> baseCRS,
boolean forceToCRS)
A Tokenizer for the specified WKT string
|
| Modifier and Type | Method and Description |
|---|---|
private int |
countPoints() |
private CoordinateReferenceSystem<?> |
determineTargetCRS() |
private CoordinateReferenceSystem<?> |
ensureZM(CoordinateReferenceSystem<?> crs,
boolean needZ,
boolean needM) |
protected double |
fastReadNumber()
Reads a number at the current position.
|
private CoordinateReferenceSystem<?> |
getCoordinateReferenceSystem() |
protected WktToken |
matchKeyword(int currentPos,
int endPos)
Matches the specifed subsequence of the WKT to a
WktToken. |
(package private) WktToken |
numericToken() |
private void |
readPoint(double[] coords) |
private void |
skipPointDelimiter() |
protected double |
toDouble(double sign,
long s,
long p,
int startPos,
int endPos)
Converts the decimal number representation into a double
This routine tries to apply the "Fast path" to get a really fast conversion, if applicable.
|
isWordChar, moreTokens, nextToken, position, readNumber, readNumberToken, readText, readToken, skipWhitespaceprivate boolean isMeasured
protected final CoordinateReferenceSystem<?> baseCRS
protected final boolean forceToCRS
private CoordinateReferenceSystem<?> targetCRS
private static long S_MAX
private static long P_MAX
protected WktTokenizer(java.lang.CharSequence wkt,
WktVariant variant,
CoordinateReferenceSystem<?> baseCRS,
boolean forceToCRS)
wkt - the string to tokenizevariant - the list of words to recognize as separate variantbaseCRS - the CoordinateReferenceSystem for the points in the WKT representation.protected WktTokenizer(java.lang.CharSequence wkt,
WktVariant variant,
CoordinateReferenceSystem<?> baseCRS)
WktToken numericToken()
numericToken in class AbstractWktTokenizerprivate void readPoint(double[] coords)
protected double fastReadNumber()
Note that this method loses precision, e.g. 51.16666723333333 becomes 51.16666723333332)
private int countPoints()
private CoordinateReferenceSystem<?> getCoordinateReferenceSystem()
private CoordinateReferenceSystem<?> determineTargetCRS()
private CoordinateReferenceSystem<?> ensureZM(CoordinateReferenceSystem<?> crs, boolean needZ, boolean needM)
private void skipPointDelimiter()
protected WktToken matchKeyword(int currentPos, int endPos)
AbstractWktTokenizerWktToken.
matchKeyword in class AbstractWktTokenizercurrentPos - the start of the subsequence to matchendPos - the end of the subsequence to matchprotected double toDouble(double sign,
long s,
long p,
int startPos,
int endPos)
sign - the sign of the numbers - the decimal mantissa or significand as a longp - the exponent as a longstartPos - the start position in the Wkt for the parsed numberendPos - the end position in the wkt for the parsed number