本文整理匯總了C#中NetTopologySuite.IO.WKTReader.Intersection方法的典型用法代碼示例。如果您正苦於以下問題:C# WKTReader.Intersection方法的具體用法?C# WKTReader.Intersection怎麽用?C# WKTReader.Intersection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NetTopologySuite.IO.WKTReader
的用法示例。
在下文中一共展示了WKTReader.Intersection方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: main
public static void main(string[] args)
{
// read a point from a WKT string (using the default point factory)
IGeometry g1 = new WKTReader().Read("LINESTRING (0 0, 10 10, 20 20)");
Console.WriteLine("Geometry 1: " + g1);
// create a point by specifying the coordinates directly
var coordinates = new [] { new Coordinate(0, 0),
new Coordinate(10, 10), new Coordinate(20, 20) };
// use the default factory, which gives full double-precision
IGeometry g2 = new GeometryFactory().CreateLineString(coordinates);
Console.WriteLine("Geometry 2: " + g2);
// compute the intersection of the two geometries
IGeometry g3 = g1.Intersection(g2);
Console.WriteLine("G1 intersection G2: " + g3);
}