|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kaboum.util.KaboumWKTReader
public class KaboumWKTReader
Converts a Well-known Text string to a Geometry
. The Well-known
Text format is defined in the
OpenGIS Simple Features Specification for SQL .
The WKTReader
assume that the input numbers are in external representation.
It will convert the input numbers to the internal representation
Constructor Summary | |
---|---|
KaboumWKTReader(KaboumPrecisionModel precisionModel)
Default constructor |
Method Summary | |
---|---|
protected KaboumCoordinate[] |
getCoordinates(java.io.StreamTokenizer tokenizer)
Returns the next array of Coordinate s in the stream. |
protected java.lang.String |
getNextCloser(java.io.StreamTokenizer tokenizer)
Returns the next ")" in the stream. |
protected java.lang.String |
getNextCloserOrComma(java.io.StreamTokenizer tokenizer)
Returns the next ")" or "," in the stream. |
protected java.lang.String |
getNextEmptyOrOpener(java.io.StreamTokenizer tokenizer)
Returns the next "EMPTY" or "(" in the stream as uppercase text. |
protected double |
getNextNumber(java.io.StreamTokenizer tokenizer)
Returns the next number in the stream. |
protected java.lang.String |
getNextWord(java.io.StreamTokenizer tokenizer)
Returns the next word in the stream as uppercase text. |
KaboumGeometry |
read(java.lang.String wellKnownText)
Converts a Well-known Text representation to a Geometry . |
protected KaboumGeometryCollection |
readGeometryCollectionText(java.io.StreamTokenizer tokenizer)
Creates a GeometryCollection using the next token in the
stream. |
protected KaboumGeometry |
readGeometryTaggedText(java.io.StreamTokenizer tokenizer)
Creates a Geometry using the next token in the stream. |
protected KaboumLinearRing |
readLinearRingText(java.io.StreamTokenizer tokenizer)
Creates a LinearRing using the next token in the stream. |
protected KaboumLineString |
readLineStringText(java.io.StreamTokenizer tokenizer)
Creates a LineString using the next token in the stream. |
protected KaboumMultiLineString |
readMultiLineStringText(java.io.StreamTokenizer tokenizer)
Creates a MultiLineString using the next token in the stream. |
protected KaboumMultiPoint |
readMultiPointText(java.io.StreamTokenizer tokenizer)
Creates a MultiPoint using the next token in the stream. |
protected KaboumMultiPolygon |
readMultiPolygonText(java.io.StreamTokenizer tokenizer)
Creates a MultiPolygon using the next token in the stream. |
protected KaboumPoint |
readPointText(java.io.StreamTokenizer tokenizer)
Creates a Point using the next token in the stream. |
protected KaboumPolygon |
readPolygonText(java.io.StreamTokenizer tokenizer)
Creates a Polygon using the next token in the stream. |
protected KaboumPoint[] |
toPoints(KaboumCoordinate[] coordinates)
Creates an array of Point s having the given Coordinate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KaboumWKTReader(KaboumPrecisionModel precisionModel)
Method Detail |
---|
public KaboumGeometry read(java.lang.String wellKnownText) throws java.lang.Exception
Geometry
.
wellKnownText
- a WKT string
java.lang.Exception
- if a parsing problem occursprotected KaboumCoordinate[] getCoordinates(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
Coordinate
s in the stream.
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next element returned by the stream should be "(" (the
beginning of "(x1 y1, x2 y2, ..., xn yn)") or "EMPTY".
java.lang.Exception
- if an unexpected token was encounteredprotected double getNextNumber(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next token must be a number.
java.lang.Exception
- if an I/O error occursprotected java.lang.String getNextEmptyOrOpener(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next token must be "EMPTY" or "(".
java.lang.Exception
- if an I/O error occursprotected java.lang.String getNextCloserOrComma(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next token must be ")" or ",".
java.io.IOException
- if an I/O error occurs
java.lang.Exception
protected java.lang.String getNextCloser(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next token must be ")".
ParseException
- if the next token is not ")"
java.lang.Exception
protected java.lang.String getNextWord(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next token must be a word.
ParseException
- if the next token is not a word
java.lang.Exception
protected KaboumGeometry readGeometryTaggedText(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
Geometry
using the next token in the stream.
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next tokens must form a <Geometry Tagged Text>.
java.lang.Exception
- if the coordinates used to create a Polygon
shell and holes do not form closed linestrings, or if an unexpected
token was encounteredprotected KaboumPoint readPointText(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
Point
using the next token in the stream.
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next tokens must form a <Point Text>.
java.lang.Exception
- if an I/O error occursprotected KaboumLineString readLineStringText(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
LineString
using the next token in the stream.
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next tokens must form a <LineString Text>.
java.lang.Exception
- if error occursprotected KaboumLinearRing readLinearRingText(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
LinearRing
using the next token in the stream.
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next tokens must form a <LineString Text>.
java.lang.Exception
- if the coordinates used to create the LinearRing
do not form a closed linestring, or if an unexpected token was
encounteredprotected KaboumMultiPoint readMultiPointText(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
MultiPoint
using the next token in the stream.
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next tokens must form a <MultiPoint Text>.
ParseException
- if an unexpected token was encountered
java.lang.Exception
protected KaboumPoint[] toPoints(KaboumCoordinate[] coordinates)
Point
s having the given Coordinate
coordinates
- the Coordinate
s with which to create the
Point
sprotected KaboumPolygon readPolygonText(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
Polygon
using the next token in the stream.
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next tokens must form a <Polygon Text>.
java.lang.Exception
- if an error occursprotected KaboumMultiLineString readMultiLineStringText(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
MultiLineString
using the next token in the stream.
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next tokens must form a <MultiLineString Text>.
java.lang.Exception
- if an unexpected token was encounteredprotected KaboumMultiPolygon readMultiPolygonText(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
MultiPolygon
using the next token in the stream.
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next tokens must form a <MultiPolygon Text>.
java.lang.Exception
- if an unexpected token was encounteredprotected KaboumGeometryCollection readGeometryCollectionText(java.io.StreamTokenizer tokenizer) throws java.lang.Exception
GeometryCollection
using the next token in the
stream.
tokenizer
- tokenizer over a stream of text in Well-known Text
format. The next tokens must form a <GeometryCollection Text>.
ParseException
- if the coordinates used to create a Polygon
shell and holes do not form closed linestrings, or if an unexpected
token was encountered
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |