/// <summary> /// Returns the Well-known Text representation of this <c>Geometry</c>. /// For a definition of the Well-known Text format, see the OpenGIS Simple /// Features Specification. /// </summary> /// <returns> /// The Well-known Text representation of this <c>Geometry</c>. /// </returns> public string ToText() { WKTWriter writer = new WKTWriter(); return writer.Write(this); }
public void UnionPolygons() { var wktReader = new WKTReader(new GeometryFactory(new PrecisionModel(1000))); var polygon1 = wktReader.Read("POLYGON((0 0,1 1,1 -1,0 0))"); var polygon2 = wktReader.Read("POLYGON((1 1,2 0,1 -1,1 1))"); var union = polygon1.Union(polygon2); var wkt = new WKTWriter().Write(union); Trace.WriteLine(wkt); Assert.AreEqual("POLYGON((0 0,1 1,2 0,1 -1,0 0))", wkt, "polygons are merged"); }
/// <summary> /// Initializes a new instance of the <see cref="WKTTest"/> class. /// </summary> public WKTTest() : base() { writer = new WKTWriter(); }