当前位置: 首页>>代码示例>>C#>>正文


C# IGeometry.SymmetricDifference方法代码示例

本文整理汇总了C#中IGeometry.SymmetricDifference方法的典型用法代码示例。如果您正苦于以下问题:C# IGeometry.SymmetricDifference方法的具体用法?C# IGeometry.SymmetricDifference怎么用?C# IGeometry.SymmetricDifference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IGeometry的用法示例。


在下文中一共展示了IGeometry.SymmetricDifference方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SymDifference

 /// <summary>
 /// Computes the set-theoretic symmetric difference of two <c>Geometry</c>s, using enhanced precision.
 /// </summary>
 /// <param name="geom0">The first Geometry.</param>
 /// <param name="geom1">The second Geometry.</param>
 /// <returns>The Geometry representing the set-theoretic symmetric difference of the input Geometries.</returns>
 public static IGeometry SymDifference(IGeometry geom0, IGeometry geom1)
 {
     ApplicationException originalEx;
     try
     {
         IGeometry result = geom0.SymmetricDifference(geom1);
         return result;
     }
     catch (ApplicationException ex)
     {
         originalEx = ex;
     }
     /*
      * If we are here, the original op encountered a precision problem
      * (or some other problem).  Retry the operation with
      * enhanced precision to see if it succeeds
      */
     try
     {
         CommonBitsOp cbo = new CommonBitsOp(true);
         IGeometry resultEP = cbo.SymDifference(geom0, geom1);
         // check that result is a valid point after the reshift to orginal precision
         if (!resultEP.IsValid)
             throw originalEx;
         return resultEP;
     }
     catch (ApplicationException)
     {
         throw originalEx;
     }
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:37,代码来源:EnhancedPrecisionOp.cs

示例2: InvokeGeometryOverlayMethod

        public static IGeometry InvokeGeometryOverlayMethod(SpatialFunction opCode, IGeometry g0, IGeometry g1)
        {
            switch (opCode)
            {
                case SpatialFunction.Intersection:
                    return g0.Intersection(g1);

                case SpatialFunction.Union:
                    return g0.Union(g1);

                case SpatialFunction.Difference:
                    return g0.Difference(g1);

                case SpatialFunction.SymDifference:
                    return g0.SymmetricDifference(g1);
            }
            throw new ArgumentException(@"Unknown overlay op code");
        }
开发者ID:abrobston,项目名称:NHibernate.Spatial,代码行数:18,代码来源:OverlayValidatedGeometryOperation.cs

示例3: IsApproximateCoincident

		private static bool IsApproximateCoincident(IGeometry g1, IGeometry g2, double tolerance)
		{
			IGeometry symdiff;
			if (g1.Dimension < Dimensions.Surface && g2.Dimension < Dimensions.Surface)
			{
				g1 = g1.Buffer(tolerance);
				g2 = g2.Buffer(tolerance);
				symdiff = g1.SymmetricDifference(g2).Buffer(tolerance);
			}
			else
			{
				symdiff = g1.SymmetricDifference(g2);
			}
			double relError = symdiff.Area / (g1.Area + g2.Area);
			return relError < tolerance;

		}
开发者ID:cdromka,项目名称:sonar-csharp,代码行数:17,代码来源:SpatialQueriesFixture.cs

示例4: symDifference

 public static IGeometry symDifference(IGeometry a, IGeometry b)
 {
     return a.SymmetricDifference(b);
 }
开发者ID:abrobston,项目名称:NHibernate.Spatial,代码行数:4,代码来源:OverlayFunctions.cs


注:本文中的IGeometry.SymmetricDifference方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。