• 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;
                }
            }

  • 相关阅读:
    1. Hello UWP
    ASP.NET MVC SignalR(1):背景
    ASP.NET MVC SignalR
    nekohtml转换html时标签变大写的问题
    nohup启动java命令导致dubbo无法注册
    SOA架构改造简单记录
    [转]BloomFilter——大规模数据处理利器
    IOS行货自动打包
    Kruskal算法java版
    prim算法java版
  • 原文地址:https://www.cnblogs.com/threestone/p/1803174.html
Copyright © 2020-2023  润新知