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

  • 相关阅读:
    Redis持久化(八)
    Redis通用命令(七)
    Redis数据结构(六)
    Redis数据结构(五)
    Redis数据结构(四)
    Redis数据结构(三)
    nodename nor servname provided, or not known
    edis.clients.jedis.exceptions.JedisDataException: MISCONF Redis is configured to save RDB snapshots,
    Redis与Java的链接Jedis(二)
    高并发Redis(Mac)环境配置(一)
  • 原文地址:https://www.cnblogs.com/threestone/p/1803174.html
Copyright © 2020-2023  润新知