Overview
The WKT Parser provides the possibility to convert geography objects defined in the format of WKT into UBIK Geography objects.
Supported Geography types
Multiline
A Multiline is an open line segment defined by 2 or more geo coordinates.
Example
using UBIK.Kernel.Geography;
string WKT_LINE = "LINESTRING (" +
"7.57993575611781 51.683810417826201 0," +
"7.579931596709839 51.683807447421998 0," +
"7.5799200326123 51.683760818713999 0," +
"7.57991875699064 51.683757153992197 0)";
WKTParser parser = new WKTParser();
GeoLine line;
if (parser.TryParseLine(WKT_LINE, out line)
{
...
}
string WKT_LINE = "LINESTRING (" +
"7.57993575611781 51.683810417826201 0," +
"7.579931596709839 51.683807447421998 0," +
"7.5799200326123 51.683760818713999 0," +
"7.57991875699064 51.683757153992197 0)";
WKTParser parser = new WKTParser();
GeoLine line;
if (parser.TryParseLine(WKT_LINE, out line)
{
...
}
Polygon
Polygon is a plane figure that is bounded by a finite chain of straight line segments closing in a loop to form a closed chain or circuit.
Example
using UBIK.Kernel.Geography;
string WKT_POLYGON= "POLYGON ("+
"7.57993575611781 51.683810417826201 0," +
"7.579931596709839 51.683807447421998 0," +
"7.5799200326123 51.683760818713999 0," +
"7.57993575611781 51.683810417826201 0)";
WKTParser parser = new WKTParser();
GeoPolygon polygon;
if (parser.TryParsePolygon(WKT_POLYGON, out polygon)
{
...
}
string WKT_POLYGON= "POLYGON ("+
"7.57993575611781 51.683810417826201 0," +
"7.579931596709839 51.683807447421998 0," +
"7.5799200326123 51.683760818713999 0," +
"7.57993575611781 51.683810417826201 0)";
WKTParser parser = new WKTParser();
GeoPolygon polygon;
if (parser.TryParsePolygon(WKT_POLYGON, out polygon)
{
...
}