getNextOrdinateFlags static method
Returns the next ordinate flag information in the stream as uppercase text. This can be Z, M or ZM.
@return the next EMPTY or L_PAREN in the stream as uppercase text. @throws ParseException if the next token is not EMPTY or L_PAREN @throws IOException if an I/O error occurs @param tokenizer tokenizer over a stream of text in Well-known Text
Implementation
static List<Ordinate> getNextOrdinateFlags(WKTTokenizer tokenizer) {
List<Ordinate> result = List.from([Ordinate.X, Ordinate.Y]);
String nextWord = lookAheadWord(tokenizer).toUpperCase();
if (StringUtils.equalsIgnoreCase(nextWord, "Z")) {
tokenizer.next();
result.add(Ordinate.Z);
} else if (StringUtils.equalsIgnoreCase(nextWord, "M")) {
tokenizer.next();
result.add(Ordinate.M);
} else if (StringUtils.equalsIgnoreCase(nextWord, "ZM")) {
tokenizer.next();
result.add(Ordinate.Z);
result.add(Ordinate.M);
}
return result;
}