| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 Coordinates 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 GeometryCollectionusing the next token in the
 stream. | 
| protected  KaboumGeometry | readGeometryTaggedText(java.io.StreamTokenizer tokenizer)Creates a Geometryusing the next token in the stream. | 
| protected  KaboumLinearRing | readLinearRingText(java.io.StreamTokenizer tokenizer)Creates a LinearRingusing the next token in the stream. | 
| protected  KaboumLineString | readLineStringText(java.io.StreamTokenizer tokenizer)Creates a LineStringusing the next token in the stream. | 
| protected  KaboumMultiLineString | readMultiLineStringText(java.io.StreamTokenizer tokenizer)Creates a MultiLineStringusing the next token in the stream. | 
| protected  KaboumMultiPoint | readMultiPointText(java.io.StreamTokenizer tokenizer)Creates a MultiPointusing the next token in the stream. | 
| protected  KaboumMultiPolygon | readMultiPolygonText(java.io.StreamTokenizer tokenizer)Creates a MultiPolygonusing the next token in the stream. | 
| protected  KaboumPoint | readPointText(java.io.StreamTokenizer tokenizer)Creates a Pointusing the next token in the stream. | 
| protected  KaboumPolygon | readPolygonText(java.io.StreamTokenizer tokenizer)Creates a Polygonusing the next token in the stream. | 
| protected  KaboumPoint[] | toPoints(KaboumCoordinate[] coordinates)Creates an array of Points having the givenCoordinate | 
| 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 occurs
protected KaboumCoordinate[] getCoordinates(java.io.StreamTokenizer tokenizer)
                                     throws java.lang.Exception
Coordinates 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 encountered
protected 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 occurs
protected 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 occurs
protected 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 encountered
protected 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 occurs
protected 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 occurs
protected 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
      encountered
protected 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.Exceptionprotected KaboumPoint[] toPoints(KaboumCoordinate[] coordinates)
Points having the given Coordinate
coordinates - the Coordinates with which to create the
      Points
protected 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 occurs
protected 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 encountered
protected 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 encountered
protected 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 | |||||||||