Contents #
- Algorithms
- GeometryFromWkbUtils
- GeometryFromWktUtils
- GetCoordinates(tokenizer)
- GetNextCloser(tokenizer)
- GetNextCloserOrComma(tokenizer)
- GetNextEmptyOrOpener(tokenizer)
- GetNextNumber(tokenizer)
- GetNextWord(tokenizer)
- ReadGeometryTaggedText(tokenizer)
- ReadLineStringText(tokenizer)
- ReadMultiLineStringText(tokenizer)
- ReadMultiPolygonText(tokenizer)
- ReadPointText(tokenizer)
- ReadPolygonText(tokenizer,exteriorRingCcw,exteriorRingCcwSpecified)
- GeometryToWkbUtils
- WriteDouble(value,writer,byteOrder)
- WriteGeometry(geometry,bWriter,byteorder)
- WriteLineString(ls,bWriter,byteorder)
- WriteMultiLineString(mls,bWriter,byteorder)
- WriteMultiPolygon(mp,bWriter,byteorder)
- WritePoint(point,bWriter,byteorder)
- WritePolygon(poly,bWriter,byteorder)
- WriteType(geometry,bWriter,byteorder)
- WriteUInt32(value,writer,byteOrder)
- GeometryToWktUtils
- AppendCoordinate(coordinate,writer)
- AppendGeometryTaggedText(geometry,writer)
- AppendLineStringTaggedText(lineString,writer)
- AppendLineStringText(lineString,writer)
- AppendMultiLineStringTaggedText(multiLineString,writer)
- AppendMultiLineStringText(multiLineString,writer)
- AppendMultiPolygonTaggedText(multiPolygon,writer)
- AppendMultiPolygonText(multiPolygon,writer)
- AppendPointTaggedText(coordinate,writer)
- AppendPointText(coordinate,writer)
- AppendPolygonTaggedText(polygon,writer)
- AppendPolygonText(polygon,writer)
- OnlyOneExteriorRing(polygon)
- WriteNumber(d)
- Parser
- StreamTokenizer
- TokenType
- WkbByteOrder
- WkbGeometryType
- WktStreamTokenizer
ArcGISRuntimeWKT.Utilities
Tests whether a ring is oriented counter-clockwise.
Returns true if ring is oriented counter-clockwise.
Name | Type | Description |
---|---|---|
ring | System.Collections.Generic.List{Esri.ArcGISRuntime.Geometry.MapPoint} | Ring to test. |
ArcGISRuntimeWKT
Converts Well-known Binary representations to a Geometry instance.
The Well-known Binary Representation for Geometry (WKBGeometry) provides a portable representation of a Geometry value as a contiguous stream of bytes. It permits Geometry values to be exchanged between an ODBC client and an SQL database in binary form.
The Well-known Binary Representation for Geometry is obtained by serializing a Geometry instance as a sequence of numeric types drawn from the set {Unsigned Integer, Double} and then serializing each numeric type as a sequence of bytes using one of two well defined, standard, binary representations for numeric types (NDR, XDR). The specific binary encoding (NDR or XDR) used for a geometry byte stream is described by a one byte tag that precedes the serialized bytes. The only difference between the two encodings of geometry is one of byte order, the XDR encoding is Big Endian, the NDR encoding is Little Endian.
Creates a Geometry based on the Well-known binary representation.
A Geometry based on the Well-known binary representation.
Name | Type | Description |
---|---|---|
reader | System.IO.BinaryReader | A BinaryReader used to read the Well-known binary representation. |
ArcGISRuntimeWKT
Converts a Well-known Text representation to a 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:
Returns the next array of Coordinates in the stream.
The next array of Coordinates in the stream, or an empty array of "EMPTY" is the next element returned by the stream.
Name | Type | Description |
---|---|---|
tokenizer | ArcGISRuntimeWKT.WktStreamTokenizer | 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". |
Returns the next ")" in the stream.
Returns the next ")" in the stream.
Name | Type | Description |
---|---|---|
tokenizer | ArcGISRuntimeWKT.WktStreamTokenizer | Tokenizer over a stream of text in Well-known Text format. The next token must be ")". |
ParseException is thrown if the next token is not ")".
Returns the next ")" or "," in the stream.
Returns the next ")" or "," in the stream.
Name | Type | Description |
---|---|---|
tokenizer | ArcGISRuntimeWKT.WktStreamTokenizer | tokenizer over a stream of text in Well-known Text format. The next token must be ")" or ",". |
ParseException is thrown if the next token is not ")" or ",".
Returns the next "EMPTY" or "(" in the stream as uppercase text.
the next "EMPTY" or "(" in the stream as uppercase text.
Name | Type | Description |
---|---|---|
tokenizer | ArcGISRuntimeWKT.WktStreamTokenizer | Tokenizer over a stream of text in Well-known Text format. The next token must be "EMPTY" or "(". |
ParseException is thrown if the next token is not "EMPTY" or "(".
Returns the next number in the stream.
Returns the next number in the stream.
Name | Type | Description |
---|---|---|
tokenizer | ArcGISRuntimeWKT.WktStreamTokenizer | Tokenizer over a stream of text in Well-known text format. The next token must be a number. |
ParseException is thrown if the next token is not a number.
Returns the next word in the stream as uppercase text.
Returns the next word in the stream as uppercase text.
Name | Type | Description |
---|---|---|
tokenizer | ArcGISRuntimeWKT.WktStreamTokenizer | Tokenizer over a stream of text in Well-known Text format. The next token must be a word. |
Exception is thrown if the next token is not a word.
Creates a Geometry using the next token in the stream.
Returns a Geometry specified by the next token in the stream.
Name | Type | Description |
---|---|---|
tokenizer | ArcGISRuntimeWKT.WktStreamTokenizer | Tokenizer over a stream of text in Well-known Text format. The next tokens must form a . |
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.
Creates a LineString using the next token in the stream.
Returns a LineString specified by the next token in the stream.
Name | Type | Description |
---|---|---|
tokenizer | ArcGISRuntimeWKT.WktStreamTokenizer | Tokenizer over a stream of text in Well-known Text format. The next tokens must form a LineString Text. |
ParseException is thrown if an unexpected token is encountered.
Creates a Polyline using the next token in the stream.
a Polyline specified by the next token in the stream
Name | Type | Description |
---|---|---|
tokenizer | ArcGISRuntimeWKT.WktStreamTokenizer | tokenizer over a stream of text in Well-known Text format. The next tokens must form a MultiLineString Text |
Creates a Polygon using the next token in the stream.
a
MultiPolygon
specified by the next token in the stream, or if if the coordinates used to create the Polygon shells and holes do not form closed linestrings.
Name | Type | Description |
---|---|---|
tokenizer | ArcGISRuntimeWKT.WktStreamTokenizer | tokenizer over a stream of text in Well-known Text format. The next tokens must form a MultiPolygon. |
Creates a Point using the next token in the stream.
Returns a Point specified by the next token in the stream.
Name | Type | Description |
---|---|---|
tokenizer | ArcGISRuntimeWKT.WktStreamTokenizer | Tokenizer over a stream of text in Well-known Text format. The next tokens must form a . |
ParseException is thrown if an unexpected token is encountered.
Creates a Polygon using the next token in the stream.
Returns a Polygon specified by the next token in the stream
Name | Type | Description |
---|---|---|
tokenizer | ArcGISRuntimeWKT.WktStreamTokenizer | Tokenizer over a stream of text in Well-known Text format. The next tokens must form a . |
exteriorRingCcw | System.Boolean | |
exteriorRingCcwSpecified | System.Boolean |
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.
ArcGISRuntimeWKT
Converts a Geometry instance to a Well-known Binary string representation.
The Well-known Binary Representation for Geometry (WKBGeometry) provides a portable representation of a Geometry value as a contiguous stream of bytes. It permits Geometry values to be exchanged between an ODBC client and an SQL database in binary form.
The Well-known Binary Representation for Geometry is obtained by serializing a Geometry instance as a sequence of numeric types drawn from the set {Unsigned Integer, Double} and then serializing each numeric type as a sequence of bytes using one of two well defined, standard, binary representations for numeric types (NDR, XDR). The specific binary encoding (NDR or XDR) used for a geometry byte stream is described by a one byte tag that precedes the serialized bytes. The only difference between the two encodings of geometry is one of byte order, the XDR encoding is Big Endian, the NDR encoding is Little Endian.
Writes a double to the binarywriter using the specified encoding
Name | Type | Description |
---|---|---|
value | System.Double | Value to write |
writer | System.IO.BinaryWriter | Binary Writer |
byteOrder | ArcGISRuntimeWKT.WkbByteOrder | byteorder |
Writes the geometry to the binary writer.
Name | Type | Description |
---|---|---|
geometry | Esri.ArcGISRuntime.Geometry.Geometry | The geometry to be written. |
bWriter | System.IO.BinaryWriter | |
byteorder | ArcGISRuntimeWKT.WkbByteOrder | Byte order |
Writes a linestring.
Name | Type | Description |
---|---|---|
ls | System.Collections.Generic.IEnumerable{Esri.ArcGISRuntime.Geometry.MapPoint} | The linestring to be written. |
bWriter | System.IO.BinaryWriter | Stream to write to. |
byteorder | ArcGISRuntimeWKT.WkbByteOrder | Byte order |
Writes a multilinestring.
Name | Type | Description |
---|---|---|
mls | Esri.ArcGISRuntime.Geometry.Polyline | The multilinestring to be written. |
bWriter | System.IO.BinaryWriter | Stream to write to. |
byteorder | ArcGISRuntimeWKT.WkbByteOrder | Byte order |
Writes a multipolygon.
Name | Type | Description |
---|---|---|
mp | Esri.ArcGISRuntime.Geometry.Polygon | The mulitpolygon to be written. |
bWriter | System.IO.BinaryWriter | Stream to write to. |
byteorder | ArcGISRuntimeWKT.WkbByteOrder | Byte order |
Writes a point.
Name | Type | Description |
---|---|---|
point | Esri.ArcGISRuntime.Geometry.MapPoint | The point to be written. |
bWriter | System.IO.BinaryWriter | Stream to write to. |
byteorder | ArcGISRuntimeWKT.WkbByteOrder | Byte order |
Writes a polygon.
Name | Type | Description |
---|---|---|
poly | Esri.ArcGISRuntime.Geometry.Polygon | The polygon to be written. |
bWriter | System.IO.BinaryWriter | Stream to write to. |
byteorder | ArcGISRuntimeWKT.WkbByteOrder | Byte order |
Writes the type number for this geometry.
Name | Type | Description |
---|---|---|
geometry | Esri.ArcGISRuntime.Geometry.Geometry | The geometry to determine the type of. |
bWriter | System.IO.BinaryWriter | Binary Writer |
byteorder | ArcGISRuntimeWKT.WkbByteOrder | Byte order |
Writes an unsigned integer to the binarywriter using the specified encoding
Name | Type | Description |
---|---|---|
value | System.UInt32 | Value to write |
writer | System.IO.BinaryWriter | Binary Writer |
byteOrder | ArcGISRuntimeWKT.WkbByteOrder | byteorder |
ArcGISRuntimeWKT
Outputs the textual representation of a 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:
Converts a Coordinate to format, then Appends it to the writer.
Name | Type | Description |
---|---|---|
coordinate | Esri.ArcGISRuntime.Geometry.MapPoint | The Coordinate to process. |
writer | System.IO.StringWriter | The output writer to Append to. |
Converts a Geometry to format, then Appends it to the writer.
Name | Type | Description |
---|---|---|
geometry | Esri.ArcGISRuntime.Geometry.Geometry | The Geometry to process. |
writer | System.IO.StringWriter | The output stream to Append to. |
Converts a LineString to LineString tagged text format,
Name | Type | Description |
---|---|---|
lineString | Esri.ArcGISRuntime.Geometry.Polyline | The LineString to process. |
writer | System.IO.StringWriter | The output stream writer to Append to. |
Converts a LineString to format, then Appends it to the writer.
Name | Type | Description |
---|---|---|
lineString | System.Collections.Generic.IReadOnlyList{Esri.ArcGISRuntime.Geometry.MapPoint} | The LineString to process. |
writer | System.IO.StringWriter | The output stream to Append to. |
Converts a MultiLineString to format, then Appends it to the writer.
Name | Type | Description |
---|---|---|
multiLineString | Esri.ArcGISRuntime.Geometry.Polyline | The MultiLineString to process |
writer | System.IO.StringWriter | The output stream writer to Append to. |
Converts a MultiLineString to format, then Appends it to the writer.
Name | Type | Description |
---|---|---|
multiLineString | Esri.ArcGISRuntime.Geometry.Polyline | The MultiLineString to process. |
writer | System.IO.StringWriter | The output stream writer to Append to. |
Converts a MultiPolygon to format, then Appends it to the writer.
Name | Type | Description |
---|---|---|
multiPolygon | Esri.ArcGISRuntime.Geometry.Polygon | The MultiPolygon to process |
writer | System.IO.StringWriter | The output stream writer to Append to. |
Converts a MultiPolygon to format, then Appends to it to the writer.
Name | Type | Description |
---|---|---|
multiPolygon | Esri.ArcGISRuntime.Geometry.Polygon | The MultiPolygon to process. |
writer | System.IO.StringWriter | The output stream to Append to. |
Converts a Coordinate to format, then Appends it to the writer.
Name | Type | Description |
---|---|---|
coordinate | Esri.ArcGISRuntime.Geometry.MapPoint | the |
Coordinate
to process | | writer | System.IO.StringWriter | the output writer to Append to |
Converts a Coordinate to Point Text format then Appends it to the writer.
Name | Type | Description |
---|---|---|
coordinate | Esri.ArcGISRuntime.Geometry.MapPoint | The Coordinate to process. |
writer | System.IO.StringWriter | The output stream writer to Append to. |
Converts a Polygon to format, then Appends it to the writer.
Name | Type | Description |
---|---|---|
polygon | Esri.ArcGISRuntime.Geometry.Polygon | Th Polygon to process. |
writer | System.IO.StringWriter | The stream writer to Append to. |
Converts a Polygon to format, then Appends it to the writer.
Name | Type | Description |
---|---|---|
polygon | Esri.ArcGISRuntime.Geometry.Polygon | The Polygon to process. |
writer | System.IO.StringWriter |
Checks whether the first ring is CW or CCW, and returns true if there is only one ring in this direction.
Name | Type | Description |
---|---|---|
polygon | Esri.ArcGISRuntime.Geometry.Polygon |
Converts a double to a string, not in scientific notation.
The double as a string, not in scientific notation.
Name | Type | Description |
---|---|---|
d | System.Double | The double to convert. |
ArcGISRuntimeWKT
convert Well Known Text (WKT) / Well Known Binary (WKB) to and from Geometry
Creates a Geometry from the supplied byte[] containing the Well-known Binary representation.
A Geometry bases on the supplied Well-known Binary representation.
Name | Type | Description |
---|---|---|
bytes | System.Byte[] | byte[] containing the Well-known Binary representation. |
Creates a Geometry based on the Well-known binary representation.
A Geometry based on the Well-known binary representation.
Name | Type | Description |
---|---|---|
reader | System.IO.BinaryReader | A BinaryReader used to read the Well-known binary representation. |
Converts a Well-known text representation to a Geometry.
Returns a Geometry specified by wellKnownText. Throws an exception if there is a parsing problem.
Name | Type | Description |
---|---|---|
wellKnownText | System.String | A Geometry tagged text string ( see the OpenGIS Simple Features Specification. ) |
Converts a Well-known Text representation to a Geometry.
Returns a Geometry read from StreamReader. An exception will be thrown if there is a parsing problem.
Name | Type | Description |
---|---|---|
reader | System.IO.TextReader | A Reader which will return a Geometry Tagged Text string (see the OpenGIS Simple Features Specification) |
Writes a geometry to a byte array using little endian byte encoding
WKB representation of the geometry
Name | Type | Description |
---|---|---|
g | Esri.ArcGISRuntime.Geometry.Geometry | The geometry to write |
Writes a geometry to a byte array using the specified encoding.
WKB representation of the geometry
Name | Type | Description |
---|---|---|
g | Esri.ArcGISRuntime.Geometry.Geometry | The geometry to write |
wkbByteOrder | ArcGISRuntimeWKT.WkbByteOrder | Byte order |
Converts a Geometry to its Well-known Text representation.
A string (see the OpenGIS Simple Features Specification)
Name | Type | Description |
---|---|---|
geometry | Esri.ArcGISRuntime.Geometry.Geometry | A Geometry to write. |
Converts a Geometry to its Well-known Text representation.
Name | Type | Description |
---|---|---|
geometry | Esri.ArcGISRuntime.Geometry.Geometry | A geometry to process. |
writer | System.IO.StringWriter | Stream to write out the geometry's text representation. |
Geometry is written to the output stream as string (see the OpenGIS Simple Features Specification).
ArcGISRuntimeWKT
The StreamTokenizer class takes an input stream and parses it into "tokens", allowing the tokens to be read one at a time. The parsing process is controlled by a table and a number of flags that can be set to various states. The stream tokenizer can recognize identifiers, numbers, quoted strings, and various comment style
This is a crude c# implementation of Java's class.
Initializes a new instance of the StreamTokenizer class.
Name | Type | Description |
---|---|---|
reader | System.IO.TextReader | A TextReader with some text to read. |
ignoreWhitespace | System.Boolean | Flag indicating whether whitespace should be ignored. |
The current column number of the stream being read.
The current line number of the stream being read.
If the current token is a number, this field contains the value of that number.
This method has no parameters.
Name | Description |
---|---|
System.FormatException | Current token is not a number in a valid format. |
If the current token is a number, this field contains the value of that number. The current token is a number when the value of the ttype field is TT_NUMBER.
If the current token is a word token, this field contains a string giving the characters of the word token.
This method has no parameters.
Gets the token type of the current token.
This method has no parameters.
Determines a characters type (e.g. number, symbols, character).
The TokenType the character is.
Name | Type | Description |
---|---|---|
character | System.Char | The character to determine. |
Returns next token that is not whitespace.
This method has no parameters.
Returns the next token.
The TokenType of the next token.
Name | Type | Description |
---|---|---|
ignoreWhitespace | System.Boolean | Determines is whitespace is ignored. True if whitespace is to be ignored. |
Returns the next token.
The TokenType of the next token.
This method has no parameters.
ArcGISRuntimeWKT
Represents the type of token created by the StreamTokenizer class.
Indicates that the end of the input stream has been reached.
Indicates that the end of line has been read. The field can only have this value if the eolIsSignificant method has been called with the argument true.
Indicates that the token is a number.
Characters that are not whitespace, numbers, etc...
Indictaes that the token is white space (space, tab, newline).
Indicates that the token is a word.
ArcGISRuntimeWKT
Specifies the specific binary encoding (NDR or XDR) used for a geometry byte stream
NDR (Little Endian) Encoding of Numeric Types
The NDR representation of an Unsigned Integer is Little Endian (least significant byte first).
The NDR representation of a Double is Little Endian (sign bit is last byte).
XDR (Big Endian) Encoding of Numeric Types
The XDR representation of an Unsigned Integer is Big Endian (most significant byte first).
The XDR representation of a Double is Big Endian (sign bit is first byte).
ArcGISRuntimeWKT
Enumeration to determine geometrytype in Well-known Binary
ArcGISRuntimeWKT
Reads a stream of Well Known Text (wkt) string and returns a stream of tokens.
Initializes a new instance of the WktStreamTokenizer class.
Name | Type | Description |
---|---|---|
reader | System.IO.TextReader | A TextReader that contains |
The WktStreamTokenizer class ais in reading WKT streams.
Reads the authority and authority code.
Name | Type | Description |
---|---|---|
authority | System.String@ | String to place the authority in. |
authorityCode | System.Int64@ | String to place the authority code in. |
Reads a string inside double quotes.
The string inside the double quotes.
This method has no parameters.
White space inside quotes is preserved.
Reads a token and checks it is what is expected.
Name | Type | Description |
---|---|---|
expectedToken | System.String | The expected token. |