C# Class SharpMap.Converters.WellKnownText.GeometryFromWKT

Converts a Well-known Text representation to a SharpMap.Geometries.Geometry instance.

The Well-Known Text (WKT) representation of Geometry is designed to exchange geometry data in ASCII form.

Examples of WKT representations of geometry objects are: Geometry WKT Representation A Point POINT(15 20)
Note that point coordinates are specified with no separating comma.
A LineString with four points: LINESTRING(0 0, 10 10, 20 25, 50 60) A Polygon with one exterior ring and one interior ring: POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7, 5 5)) A MultiPoint with three Point values: MULTIPOINT(0 0, 20 20, 60 60) A MultiLineString with two LineString values: MULTILINESTRING((10 10, 20 20), (15 15, 30 15)) A MultiPolygon with two Polygon values: MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)),((5 5,7 5,7 7,5 7, 5 5))) A GeometryCollection consisting of two Point values and one LineString: GEOMETRYCOLLECTION(POINT(10 10), POINT(30 30), LINESTRING(15 15, 20 20))
Afficher le fichier Open project: jumpinjackie/fdotoolbox

Méthodes publiques

Méthode Description
Parse ( System reader ) : Geometry

Converts a Well-known Text representation to a SharpMap.Geometries.Geometry.

Parse ( string wellKnownText ) : Geometry

Converts a Well-known text representation to a SharpMap.Geometries.Geometry.

Private Methods

Méthode Description
GetCoordinates ( WktStreamTokenizer tokenizer ) : List

Returns the next array of Coordinates in the stream.

GetNextCloser ( WktStreamTokenizer tokenizer ) : string

Returns the next ")" in the stream.

ParseException is thrown if the next token is not ")".

GetNextCloserOrComma ( WktStreamTokenizer tokenizer ) : string

Returns the next ")" or "," in the stream.

ParseException is thrown if the next token is not ")" or ",".

GetNextEmptyOrOpener ( WktStreamTokenizer tokenizer ) : string

Returns the next "EMPTY" or "(" in the stream as uppercase text.

ParseException is thrown if the next token is not "EMPTY" or "(".

GetNextNumber ( WktStreamTokenizer tokenizer ) : double

Returns the next number in the stream.

ParseException is thrown if the next token is not a number.

GetNextWord ( WktStreamTokenizer tokenizer ) : string

Returns the next word in the stream as uppercase text.

Exception is thrown if the next token is not a word.

ReadGeometryCollectionText ( WktStreamTokenizer tokenizer ) : GeometryCollection

Creates a GeometryCollection using the next token in the stream.

ReadGeometryTaggedText ( WktStreamTokenizer tokenizer ) : Geometry

Creates a Geometry using the next token in the stream.

Exception is thrown if the coordinates used to create a Polygon shell and holes do not form closed linestrings, or if an unexpected token is encountered.

ReadLineStringText ( WktStreamTokenizer tokenizer ) : LineString

Creates a LineString using the next token in the stream.

ParseException is thrown if an unexpected token is encountered.

ReadMultiLineStringText ( WktStreamTokenizer tokenizer ) : MultiLineString

Creates a MultiLineString using the next token in the stream.

ReadMultiPointText ( WktStreamTokenizer tokenizer ) : MultiPoint

Creates a Point using the next token in the stream.

ParseException is thrown if an unexpected token is encountered.

ReadMultiPolygonText ( WktStreamTokenizer tokenizer ) : MultiPolygon

Creates a MultiPolygon using the next token in the stream.

ReadPointText ( WktStreamTokenizer tokenizer ) : System.Point

Creates a Point using the next token in the stream.

ParseException is thrown if an unexpected token is encountered.

ReadPolygonText ( WktStreamTokenizer tokenizer ) : Polygon

Creates a Polygon using the next token in the stream.

ParseException is thown if the coordinates used to create the Polygon shell and holes do not form closed linestrings, or if an unexpected token is encountered.

Method Details

Parse() public static méthode

Converts a Well-known Text representation to a SharpMap.Geometries.Geometry.
public static Parse ( System reader ) : Geometry
reader System A Reader which will return a Geometry Tagged Text /// string (see the OpenGIS Simple Features Specification)
Résultat Geometry

Parse() public static méthode

Converts a Well-known text representation to a SharpMap.Geometries.Geometry.
public static Parse ( string wellKnownText ) : Geometry
wellKnownText string A tagged text string ( see the OpenGIS Simple Features Specification.
Résultat Geometry