本文整理匯總了C#中NetTopologySuite.IO.WKTReader.GetType方法的典型用法代碼示例。如果您正苦於以下問題:C# WKTReader.GetType方法的具體用法?C# WKTReader.GetType怎麽用?C# WKTReader.GetType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NetTopologySuite.IO.WKTReader
的用法示例。
在下文中一共展示了WKTReader.GetType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestSimplifyBadPoly
public void TestSimplifyBadPoly()
{
var geom = new WKTReader().Read("POLYGON ((1 1, 1 1, 1 1, 1 1, 1 1))");
var geom2 = new Polygon(new LinearRing(new Coordinate[]
{
new Coordinate(1, 1),
new Coordinate(1, 1),
new Coordinate(1, 1),
new Coordinate(1, 1),
new Coordinate(1, 1)
}));
Debug.WriteLine("Bad polygon: " + geom);
var simple = DouglasPeuckerSimplifier.Simplify(geom, 0.1);
Debug.WriteLine("Simple bad polygon: " + simple);
Assert.AreEqual(geom.GetType(), simple.GetType());
Assert.AreNotEqual(geom, simple, "Simplify didn't do anything to this invalid polygon.");
// This happens with JTS 1.9.0, 1.8.0 still returns GeometryCollection.Empty
Assert.AreEqual(geom.GetType(), Polygon.Empty);
}