zoukankan      html  css  js  c++  java
  • ITopologicalOperator Intersect

       /// <summary>
            /// 判断2个几何图形是否相交
            /// </summary>
            /// <param name="oneGeometry"></param>
            /// <param name="otherGeometry"></param>
            /// <returns></returns>
            public bool Intersect(IGeometry oneGeometry, IGeometry otherGeometry)
            {
                try
                {
                    ISpatialReferenceFactory3 pSRF = new SpatialReferenceEnvironmentClass();
                    ISpatialReference pSR = pSRF.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_Beijing1954);
                    pSR.SetDomain(-400, -400, 400, 400);

                    oneGeometry.SpatialReference = pSR;
                    otherGeometry.SpatialReference = pSR;

                    ITopologicalOperator iTopoOperator = (ITopologicalOperator)oneGeometry;

                   
                    IGeometry outGeometry = iTopoOperator.Intersect(otherGeometry, esriGeometryDimension.esriGeometryNoDimension);
                    if (!outGeometry.IsEmpty)
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }          
                }
                catch (Exception ex)
                {
                    return false;
                }
            }

  • 相关阅读:
    R中character和factor的as.integer的不同
    ggplot2练习
    R的plotmath
    Python数据科学手册(2) NumPy入门
    Python数据科学手册(1) IPython:超越Python
    ggplot2(6) 标度、坐标轴和图例
    R自带数据集
    ggplot2(5) 工具箱
    MATLAB神经网络(7) RBF网络的回归——非线性函数回归的实现
    ggplot2(4) 用图层构建图像
  • 原文地址:https://www.cnblogs.com/threestone/p/1803174.html
Copyright © 2011-2022 走看看